mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 03:25:21 +00:00
File read error was not catched.
This commit is contained in:
parent
a593d27e3d
commit
ca1628cf2b
@ -111,9 +111,9 @@ def get_all_imports(
|
||||
candidates += [os.path.splitext(fn)[0] for fn in files]
|
||||
for file_name in files:
|
||||
file_name = os.path.join(root, file_name)
|
||||
with open(file_name, "r", encoding=encoding) as f:
|
||||
contents = f.read()
|
||||
try:
|
||||
with open(file_name, "r", encoding=encoding) as f:
|
||||
contents = f.read()
|
||||
tree = ast.parse(contents)
|
||||
for node in ast.walk(tree):
|
||||
if isinstance(node, ast.Import):
|
||||
|
Loading…
x
Reference in New Issue
Block a user