Skip to content

fix: six.moves.reload_module uses imp.reload in Python 2 (#158)#404

Open
fazalpsinfo-cmyk wants to merge 1 commit into
benjaminp:mainfrom
fazalpsinfo-cmyk:fix/int2byte-docs-163
Open

fix: six.moves.reload_module uses imp.reload in Python 2 (#158)#404
fazalpsinfo-cmyk wants to merge 1 commit into
benjaminp:mainfrom
fazalpsinfo-cmyk:fix/int2byte-docs-163

Conversation

@fazalpsinfo-cmyk

Copy link
Copy Markdown

Fix: DeprecationWarning from reload_module in Python 2 -3 mode

reload() in Python 2 emits DeprecationWarning when run with -3 flag
because reload is removed in Python 3. Changed the source from
__builtin__.reload to imp.reload which is the preferred API and
does not trigger the warning.

Python 3 paths are unaffected (already use importlib.reload / imp.reload).

Fixes #158

Support my work: If this fix helped, consider buying me a coffee at https://buymeacoffee.com/muhamedfazalps

…recationWarning (benjaminp#158)

reload() in Python 2 emits DeprecationWarning when run with -3 flag.
Changing the source from __builtin__ (built-in reload) to imp.reload
eliminates the warning since imp.reload is the preferred way to reload
in Python 2.

Fixes benjaminp#158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning from six.moves.reload_module

1 participant