Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
dothinking committed May 31, 2021
1 parent 21bddaa commit c24a3be
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ def load_long_description(fname):

def load_requirements(fname):
try:
from pip._internal.req import parse_requirements
reqs = parse_requirements(fname, session=False)
try:
requirements = [str(ir.requirement) for ir in reqs]
except AttributeError:
requirements = [str(ir.req) for ir in reqs]
# pip >= 10.0
from pip._internal.req import parse_requirements
except ImportError:
# pip < 10.0
from pip.req import parse_requirements
reqs = parse_requirements(fname, session=False)

reqs = parse_requirements(fname, session=False)
try:
requirements = [str(ir.requirement) for ir in reqs]
except AttributeError:
requirements = [str(ir.req) for ir in reqs]

return requirements
Expand Down

0 comments on commit c24a3be

Please sign in to comment.