-
Notifications
You must be signed in to change notification settings - Fork 4
Update rollback.py #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/rollback
Are you sure you want to change the base?
Update rollback.py #612
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has nothing to do with rollback. Now what?
from ... import rollback
with rollback.chdir(...):
....
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't we support 3.10 if all it requires is not using this chdir thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.