mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 03:25:21 +00:00
Improve except block in function parse_requirements
This commit is contained in:
parent
b048c55fe6
commit
888537a898
@ -229,9 +229,9 @@ def parse_requirements(file_):
|
||||
try:
|
||||
with open(file_, "r") as f:
|
||||
data = [x.strip() for x in f.readlines() if x != "\n"]
|
||||
except OSError as e:
|
||||
logging.error(e)
|
||||
sys.exit(0)
|
||||
except OSError:
|
||||
logging.error("Failed on file {}".format(file_))
|
||||
raise
|
||||
|
||||
parameters = [x for x in data if x.startswith("-")]
|
||||
data = [x for x in data if x[0].isalpha()]
|
||||
|
Loading…
x
Reference in New Issue
Block a user