Message332390
2to3 (in python 3.6.6) will rewrite the reload function to use the imp module. However according to [1] "Deprecated since version 3.4: The imp package is pending deprecation in favor of importlib."
Also running the code with warnings enabled will show a deprecation warning.
Example, take this minimal script:
#!/usr/bin/python
import sys
reload(sys)
Running to 2to3 ends up with:
#!/usr/bin/python
import sys
import imp
imp.reload(sys)
$ PYTHONWARNINGS=d python3 foo.py
test.py:3: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
[1] https://docs.python.org/3/library/imp.html |
|
Date |
User |
Action |
Args |
2018-12-23 12:58:40 | hanno | set | recipients:
+ hanno |
2018-12-23 12:58:37 | hanno | set | messageid: <1545569917.75.0.0770528567349.issue35570@roundup.psfhosted.org> |
2018-12-23 12:58:37 | hanno | link | issue35570 messages |
2018-12-23 12:58:37 | hanno | create | |
|