summaryrefslogtreecommitdiffstats
path: root/Lib/pyclbr.py
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2014-01-07 03:42:59 (GMT)
committerEric Snow <ericsnowcurrently@gmail.com>2014-01-07 03:42:59 (GMT)
commit02b9f9d6bb596d437ac10d71afac8a4781d18d86 (patch)
tree1193a4aa2a6b434eb4fc6bea0e561d32b5dafb80 /Lib/pyclbr.py
parent3a62d14b24843de4884ea8d0167bc1285b285a97 (diff)
downloadcpython-02b9f9d6bb596d437ac10d71afac8a4781d18d86.zip
cpython-02b9f9d6bb596d437ac10d71afac8a4781d18d86.tar.gz
cpython-02b9f9d6bb596d437ac10d71afac8a4781d18d86.tar.bz2
Remove more usage of APIs deprecated by PEP 451.
Diffstat (limited to 'Lib/pyclbr.py')
-rw-r--r--Lib/pyclbr.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py
index 9ec05ee..a8d2b1f 100644
--- a/Lib/pyclbr.py
+++ b/Lib/pyclbr.py
@@ -140,13 +140,14 @@ def _readmodule(module, path, inpackage=None):
search_path = path
else:
search_path = path + sys.path
- loader = importlib.find_loader(fullmodule, search_path)
- fname = loader.get_filename(fullmodule)
+ # XXX This will change once issue19944 lands.
+ spec = importlib.find_spec(fullmodule, search_path)
+ fname = spec.loader.get_filename(fullmodule)
_modules[fullmodule] = dict
- if loader.is_package(fullmodule):
+ if spec.loader.is_package(fullmodule):
dict['__path__'] = [os.path.dirname(fname)]
try:
- source = loader.get_source(fullmodule)
+ source = spec.loader.get_source(fullmodule)
if source is None:
return dict
except (AttributeError, ImportError):