Skip to content

Commit

Permalink
Allow importing wheel files. Close #541
Browse files Browse the repository at this point in the history
  • Loading branch information
PCManticore committed Jul 11, 2019
1 parent 28fc86f commit 334a67d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion astroid/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
from astroid import transforms


ZIP_IMPORT_EXTS = (".zip", ".egg", ".whl")


def safe_repr(obj):
try:
return repr(obj)
Expand Down Expand Up @@ -185,7 +188,7 @@ def zip_import_data(self, filepath):
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:
Expand Down

0 comments on commit 334a67d

Please sign in to comment.