Skip to content

Commit 97ec58b

Browse files
committed
Safer comment handling of requirements files
1 parent 5125976 commit 97ec58b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
def obtain_requirements(file_name):
1010
with open(file_name) as fd_in:
1111
for line in fd_in:
12-
if '#' not in line:
13-
yield line.strip()
12+
line = line.split('#')[0].strip()
13+
if line:
14+
yield line
1415

1516

1617
class PyTest(Command):

0 commit comments

Comments
 (0)