-
Notifications
You must be signed in to change notification settings - Fork 1.9k
🚨 Depreciation warning fixes #2227
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
Conversation
Fixes running `tox` outputs warnings: - replaces the `imp` module by the `importlib` one - simplifies downloader dropping `FancyURLopener` The warnings were: ``` pythonforandroid/util.py:17 /home/andre/workspace/python-for-android/pythonforandroid/util.py:17: DeprecationWarning: WgetDownloader style of invoking requests is deprecated. Use newer urlopen functions/methods urlretrieve = WgetDownloader().retrieve pythonforandroid/toolchain.py:84 /home/andre/workspace/python-for-android/pythonforandroid/toolchain.py:84: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp ```
BuildInterruptingException) | ||
|
||
|
||
def import_recipe(module, filename): |
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.
Moved to pythonforandroid/util.py
and renamed to load_source
version = ('Wget/1.17.1') | ||
|
||
|
||
urlretrieve = WgetDownloader().retrieve |
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.
Fully replaced by simply from urllib.request import urlretrieve
else: | ||
# Python 3.3 and 3.4: | ||
from importlib.machinery import SourceFileLoader | ||
return SourceFileLoader(module, filename).load_module() |
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 was tempted to completely ditch the Python 3.3/3.4 part, but didn't want to risk it in this one. Let's keep it for later
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.
LGTM, thanks!!
💯
Fixes running
tox
outputs warnings:imp
module by theimportlib
oneFancyURLopener
The warnings were: