-
Notifications
You must be signed in to change notification settings - Fork 291
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
WIP Python 3.12 support for removal of imp module #626
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,10 @@ | |
Inspired by and based on ``uprefix`` by Vinay M. Sajip. | ||
""" | ||
|
||
import imp | ||
try: | ||
import imp | ||
except ImportError: | ||
import importlib | ||
Comment on lines
+35
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When both modules are available, it would be better to prefer There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
import logging | ||
import marshal | ||
import os | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -447,9 +447,14 @@ def test_reload(self): | |||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
reload has been moved to the imp module | ||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
import imp | ||||||||||||||||||||||||||||
imp.reload(imp) | ||||||||||||||||||||||||||||
self.assertTrue(True) | ||||||||||||||||||||||||||||
try: | ||||||||||||||||||||||||||||
import imp | ||||||||||||||||||||||||||||
imp.reload(imp) | ||||||||||||||||||||||||||||
self.assertTrue(True) | ||||||||||||||||||||||||||||
except ImportError: | ||||||||||||||||||||||||||||
import importlib | ||||||||||||||||||||||||||||
importlib.reload(importlib) | ||||||||||||||||||||||||||||
self.assertTrue(True) | ||||||||||||||||||||||||||||
Comment on lines
+451
to
+457
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
def test_install_aliases(self): | ||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
|
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 that
and moving the block after
from future.utils import PY2, PY3
should be enough (i.e. no change needed to_find_and_load_module()
), since theRenameImport
class is only instantiated under Python2.