mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 12:05:33 +00:00
Python 3 Compatability
This commit is contained in:
parent
2059626583
commit
bc5cd169ec
@ -68,14 +68,14 @@ def get_all_imports(path, encoding=None):
|
|||||||
raw_imports.add(subnode.name)
|
raw_imports.add(subnode.name)
|
||||||
elif isinstance(node, ast.ImportFrom):
|
elif isinstance(node, ast.ImportFrom):
|
||||||
raw_imports.add(node.module)
|
raw_imports.add(node.module)
|
||||||
except Exception, e:
|
except Exception as exc:
|
||||||
if ignore_errors:
|
if ignore_errors:
|
||||||
traceback.print_exc(e)
|
traceback.print_exc(exc)
|
||||||
logging.warn("Failed on file: %s" % os.path.join(root, file_name))
|
logging.warn("Failed on file: %s" % os.path.join(root, file_name))
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
logging.error("Failed on file: %s" % os.path.join(root, file_name))
|
logging.error("Failed on file: %s" % os.path.join(root, file_name))
|
||||||
raise e
|
raise exc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user