Skip to content

Commit

Permalink
Fuller fix for #51.
Browse files Browse the repository at this point in the history
*grumble grumble falsey empty string grumble grumble*
  • Loading branch information
dloscutoff committed Mar 19, 2022
1 parent 0d36cd1 commit ba51ee7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def pip(code=None, argv=None, interactive=True):
"n" if options.newline else
"l" if options.lines else
None)
if code is None and not (options.execute or options.file or options.stdin):
if (code is None and options.execute is None and options.file is None
and not options.stdin):
if interactive:
options.stdin = True
print("Enter your program, terminated by Ctrl-D or Ctrl-Z:")
Expand All @@ -155,10 +156,10 @@ def pip(code=None, argv=None, interactive=True):
if code is not None:
# Code is passed into function
program = code
elif options.execute:
elif options.execute is not None:
# Code is given as command-line argument
program = options.execute
elif options.file:
elif options.file is not None:
# Get code from specified file
if interactive:
print("Reading", options.file)
Expand Down

0 comments on commit ba51ee7

Please sign in to comment.