Skip to content

Commit

Permalink
Merge pull request #113 from eire1130/develop
Browse files Browse the repository at this point in the history
 Removed deprecated find_loader in favor of find_spec and removed py33 support as a result
  • Loading branch information
GrahamDumpleton authored Aug 22, 2018
2 parents 5445543 + e0c3f01 commit abe5f52
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/wrapt/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,18 @@ def find_module(self, fullname, path=None):

try:
if PY3:
# For Python 3 we need to use find_loader() from
# the importlib module. It doesn't actually
# For Python 3 we need to use find_spec().loader
# from the importlib.util module. It doesn't actually
# import the target module and only finds the
# loader. If a loader is found, we need to return
# our own loader which will then in turn call the
# real loader to import the module and invoke the
# post import hooks.

loader = importlib.find_loader(fullname, path)

try:
import importlib.util
loader = importlib.util.find_spec(fullname).loader
except (ImportError, AttributeError):
loader = importlib.find_loader(fullname, path)
if loader:
return _ImportHookChainedLoader(loader)

Expand Down

0 comments on commit abe5f52

Please sign in to comment.