-
Notifications
You must be signed in to change notification settings - Fork 55
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
support py312 #306
support py312 #306
Conversation
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
|
||
|
||
@contextmanager | ||
def resource_stream_compat(package, resource_name): |
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.
I don't understand the purpose of this function.
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.
I think it made more sense when i was trying to have it dynamically use pkg_resources if available ... however, as you point out, it's unnecessary now. I'll remove it.
str: The file path to the resource. | ||
""" | ||
# Fallback to importlib.resources if pkg_resources is not available | ||
temp_dir = tempfile.mkdtemp() |
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.
You can use tempfile.TemporaryDirectory
that implements context-manager protocol.
https://docs.python.org/3/library/tempfile.html#tempfile.TemporaryDirectory
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
https://stackoverflow.com/questions/7446187/no-module-named-pkg-resources