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:
|
try:
|
||||||
with open(file_, "r") as f:
|
with open(file_, "r") as f:
|
||||||
data = [x.strip() for x in f.readlines() if x != "\n"]
|
data = [x.strip() for x in f.readlines() if x != "\n"]
|
||||||
except OSError as e:
|
except OSError:
|
||||||
logging.error(e)
|
logging.error("Failed on file {}".format(file_))
|
||||||
sys.exit(0)
|
raise
|
||||||
|
|
||||||
parameters = [x for x in data if x.startswith("-")]
|
parameters = [x for x in data if x.startswith("-")]
|
||||||
data = [x for x in data if x[0].isalpha()]
|
data = [x for x in data if x[0].isalpha()]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user