diff options
| author | Alex Grönholm <alex.gronholm@nextday.fi> | 2018-07-16 22:17:37 +0300 |
|---|---|---|
| committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2018-07-17 15:02:50 +0300 |
| commit | ded1ad49a538114626ec57385de1b1145159ad54 (patch) | |
| tree | d760377dbcabb687f00e3220b9e3068f96f26625 | |
| parent | 59976ab294e1b118f42cab404d95df66ed55f7e4 (diff) | |
| download | wheel-git-ded1ad49a538114626ec57385de1b1145159ad54.tar.gz | |
Avoid importing the deprecated "imp" module if possible
| -rw-r--r-- | wheel/pep425tags.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wheel/pep425tags.py b/wheel/pep425tags.py index 29afdc3..52f8ad9 100644 --- a/wheel/pep425tags.py +++ b/wheel/pep425tags.py @@ -6,6 +6,11 @@ import sys import sysconfig import warnings +try: + from importlib.machinery import get_all_suffixes +except ImportError: + from imp import get_suffixes as get_all_suffixes + def get_config_var(var): try: @@ -132,8 +137,7 @@ def get_supported(versions=None, supplied_platform=None): abis[0:0] = [abi] abi3s = set() - import imp - for suffix in imp.get_suffixes(): + for suffix in get_all_suffixes(): if suffix[0].startswith('.abi'): abi3s.add(suffix[0].split('.', 2)[1]) |
