diff options
Diffstat (limited to 'Lib/modulefinder.py')
-rw-r--r-- | Lib/modulefinder.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index a197a0d..ebd068a 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -1,13 +1,16 @@ """Find modules used by a script, using introspection.""" import dis -import imp import importlib.machinery import marshal import os import sys import types import struct +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', PendingDeprecationWarning) + import imp # XXX Clean up once str8's cstor matches bytes. LOAD_CONST = bytes([dis.opname.index('LOAD_CONST')]) @@ -229,7 +232,7 @@ class ModuleFinder: for dir in m.__path__: try: names = os.listdir(dir) - except os.error: + except OSError: self.msg(2, "can't list directory", dir) continue for name in names: |