summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-07-11 09:26:09 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2019-07-11 09:26:09 +0200
commit334a67db16b993a24e1d0267442f4a147bad5922 (patch)
tree83a735c04b3492f522640268b2500e7370131f6b
parent28fc86f260f0cd9433d0603da81ee52045f9e4c3 (diff)
downloadastroid-git-334a67db16b993a24e1d0267442f4a147bad5922.tar.gz
Allow importing wheel files. Close #541
-rw-r--r--ChangeLog2
-rw-r--r--astroid/manager.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 50dd1e21..cf4893ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@ What's New in astroid 2.3.0?
============================
Release Date: TBA
+* Allow importing wheel files. Close #541
+
* Annotated AST follows PEP8 coding style when converted to string.
* Fix a bug where defining a class using type() could cause a DuplicateBasesError.
diff --git a/astroid/manager.py b/astroid/manager.py
index 4388514a..75115980 100644
--- a/astroid/manager.py
+++ b/astroid/manager.py
@@ -26,6 +26,9 @@ from astroid import modutils
from astroid import transforms
+ZIP_IMPORT_EXTS = (".zip", ".egg", ".whl")
+
+
def safe_repr(obj):
try:
return repr(obj)
@@ -185,7 +188,7 @@ class AstroidManager:
from astroid.builder import AstroidBuilder
builder = AstroidBuilder(self)
- for ext in (".zip", ".egg"):
+ for ext in ZIP_IMPORT_EXTS:
try:
eggpath, resource = filepath.rsplit(ext + os.path.sep, 1)
except ValueError: