Skip to content

Commit

Permalink
fix bad variable assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
nateprewitt committed Jan 3, 2018
1 parent 50ad774 commit 68d1a29
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pipenv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ def install(
remote = True

if requirements:
error, e = None, None
error, traceback = None, None
click.echo(crayons.normal(u'Requirements file provided! Importing into Pipfile…', bold=True), err=True)
try:
import_requirements(r=project.path_to(requirements), dev=dev)
Expand All @@ -1801,18 +1801,20 @@ def install(
req_path = requirements_url if remote else project.path_to(requirements)
error = (u'Unexpected syntax in {0}. Are you sure this is a '
'requirements.txt style file?'.format(req_path))
traceback = e
except AssertionError as e:
error = (u'Requirements file doesn\'t appear to exist. Please ensure the file exists in your '
'project directory or you provided the correct path.')
traceback = e
finally:
# If requirements file was provided by remote url delete the temporary file
if remote:
os.close(fd) # Close for windows to allow file cleanup.
os.remove(project.path_to(temp_reqs))

if error and e:
if error and traceback:
click.echo(crayons.red(error))
click.echo(crayons.blue(str(e)), err=True)
click.echo(crayons.blue(str(traceback)), err=True)
sys.exit(1)

if code:
Expand Down

0 comments on commit 68d1a29

Please sign in to comment.