-
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
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 |
---|---|---|
|
@@ -4,19 +4,9 @@ | |
import shutil | ||
from fnmatch import fnmatch | ||
from tempfile import mkdtemp | ||
|
||
from urllib.request import FancyURLopener | ||
|
||
from pythonforandroid.logger import (logger, Err_Fore, error, info) | ||
|
||
|
||
class WgetDownloader(FancyURLopener): | ||
version = ('Wget/1.17.1') | ||
|
||
|
||
urlretrieve = WgetDownloader().retrieve | ||
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. Fully replaced by simply |
||
|
||
|
||
build_platform = '{system}-{machine}'.format( | ||
system=uname()[0], machine=uname()[-1]).lower() | ||
"""the build platform in the format `system-machine`. We use | ||
|
@@ -84,6 +74,20 @@ def walk_valid_filens(base_dir, invalid_dir_names, invalid_file_patterns): | |
yield join(dirn, filen) | ||
|
||
|
||
def load_source(module, filename): | ||
# Python 3.5+ | ||
import importlib.util | ||
if hasattr(importlib.util, 'module_from_spec'): | ||
spec = importlib.util.spec_from_file_location(module, filename) | ||
mod = importlib.util.module_from_spec(spec) | ||
spec.loader.exec_module(mod) | ||
return mod | ||
else: | ||
# Python 3.3 and 3.4: | ||
from importlib.machinery import SourceFileLoader | ||
return SourceFileLoader(module, filename).load_module() | ||
Comment on lines
+85
to
+88
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. 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 |
||
|
||
|
||
class BuildInterruptingException(Exception): | ||
def __init__(self, message, instructions=None): | ||
super().__init__(message, instructions) | ||
|
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 toload_source