Conversation
|
|
||
| # https://www.youtube.com/watch?v=0GRLhpMao3I | ||
| # async-signal safe is the strongest concept of reentrancy. | ||
| # async-signal safe implies thread safe. |
There was a problem hiding this comment.
surprised the comments passed linters haha
| @contextmanager | ||
| def chdir(new_dir): | ||
| """Change the current working directory temporarily.""" | ||
| old_dir = os.getcwd() | ||
| try: | ||
| os.chdir(new_dir) | ||
| yield | ||
| finally: | ||
| os.chdir(old_dir) |
There was a problem hiding this comment.
this has nothing to do with rollback. Now what?
from ... import rollback
with rollback.chdir(...):
....
?
There was a problem hiding this comment.
besides this is not the first version of this context manager just to change dirs either. Why would we keep supporting 3.10?
There was a problem hiding this comment.
What exactly does the context lib version of chdir that this does not?
It can be used in the manner your suggesting?
I don't really understand why this specific function is so important?
There was a problem hiding this comment.
Why wouldn't we support 3.10 if all it requires is not using this chdir thing?
There was a problem hiding this comment.
well there are other limitations, such as StrEnum, IntEnum etc. and who knows what else. 3.10 is from 2021, pretty old by now. End of life support still 1 year 7 month tho
No description provided.