Skip to content

Commit

Permalink
fixup! Try native support instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jpic committed Dec 16, 2016
1 parent 57b86dc commit 611c403
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions django/core/management/commands/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

class Command(BaseCommand):
help = (
"Runs Python code passed through standard input if any otherwise "
"runs an interactive interpreter, like the python CLI. "
"It tries to use Tries to use IPython or bpython, if one of them is available."
"Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available"
"Like the python CLI, it would read and execute code passed to standard input if any and then exit."
)

requires_system_checks = False
Expand Down Expand Up @@ -121,8 +120,8 @@ def handle(self, **options):
exec(options['command'])
return

if select.select([sys.stdin], [], [], 0.0)[0]:
# Execute stdin and exit
# Execute stdin if it has anything to read and exit
if select.select([sys.stdin], [], [], 0)[0]:
exec(sys.stdin.read())
return

Expand Down

0 comments on commit 611c403

Please sign in to comment.