mirror of https://github.com/pypa/pip
Merge pull request #5709 from BoboTiG/fix-warnings
Fix several warnings
This commit is contained in:
commit
52cf26e5cb
|
@ -11,6 +11,7 @@ import warnings
|
|||
from collections import OrderedDict
|
||||
|
||||
import pip._internal.utils.glibc
|
||||
from pip._internal.utils.compat import get_extension_suffixes
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -252,10 +253,9 @@ def get_supported(versions=None, noarch=False, platform=None,
|
|||
abis[0:0] = [abi]
|
||||
|
||||
abi3s = set()
|
||||
import imp
|
||||
for suffix in imp.get_suffixes():
|
||||
if suffix[0].startswith('.abi'):
|
||||
abi3s.add(suffix[0].split('.', 2)[1])
|
||||
for suffix in get_extension_suffixes():
|
||||
if suffix.startswith('.abi'):
|
||||
abi3s.add(suffix.split('.', 2)[1])
|
||||
|
||||
abis.extend(sorted(list(abi3s)))
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ except ImportError:
|
|||
__all__ = [
|
||||
"ipaddress", "uses_pycache", "console_to_str", "native_str",
|
||||
"get_path_uid", "stdlib_pkgs", "WINDOWS", "samefile", "get_terminal_size",
|
||||
"get_extension_suffixes",
|
||||
]
|
||||
|
||||
|
||||
|
@ -160,6 +161,18 @@ def get_path_uid(path):
|
|||
return file_uid
|
||||
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
from importlib.machinery import EXTENSION_SUFFIXES
|
||||
|
||||
def get_extension_suffixes():
|
||||
return EXTENSION_SUFFIXES
|
||||
else:
|
||||
from imp import get_suffixes
|
||||
|
||||
def get_extension_suffixes():
|
||||
return [suffix[0] for suffix in get_suffixes()]
|
||||
|
||||
|
||||
def expanduser(path):
|
||||
"""
|
||||
Expand ~ and ~user constructions.
|
||||
|
|
|
@ -475,7 +475,7 @@ if __name__ == '__main__':
|
|||
if warn_script_location:
|
||||
msg = message_about_scripts_not_on_PATH(generated_console_scripts)
|
||||
if msg is not None:
|
||||
logger.warn(msg)
|
||||
logger.warning(msg)
|
||||
|
||||
if len(gui) > 0:
|
||||
generated.extend(
|
||||
|
|
|
@ -66,7 +66,8 @@ class TestRequirementSet(object):
|
|||
|
||||
build_dir = os.path.join(self.tempdir, 'build', 'simple')
|
||||
os.makedirs(build_dir)
|
||||
open(os.path.join(build_dir, "setup.py"), 'w')
|
||||
with open(os.path.join(build_dir, "setup.py"), 'w'):
|
||||
pass
|
||||
reqset = RequirementSet()
|
||||
req = install_req_from_line('simple')
|
||||
req.is_direct = True
|
||||
|
|
Loading…
Reference in New Issue