diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py
index f883fb9..7be3897 100644
a
|
b
|
class Command(NoArgsCommand):
|
83 | 83 | |
84 | 84 | # We want to honor both $PYTHONSTARTUP and .pythonrc.py, so follow system |
85 | 85 | # conventions and get $PYTHONSTARTUP first then .pythonrc.py. |
86 | | if not use_plain: |
87 | | for pythonrc in (os.environ.get("PYTHONSTARTUP"), |
88 | | os.path.expanduser('~/.pythonrc.py')): |
89 | | if pythonrc and os.path.isfile(pythonrc): |
90 | | try: |
91 | | with open(pythonrc) as handle: |
92 | | exec(compile(handle.read(), pythonrc, 'exec')) |
93 | | except NameError: |
94 | | pass |
| 86 | for pythonrc in (os.environ.get("PYTHONSTARTUP"), |
| 87 | os.path.expanduser('~/.pythonrc.py')): |
| 88 | if pythonrc and os.path.isfile(pythonrc): |
| 89 | try: |
| 90 | with open(pythonrc) as handle: |
| 91 | exec(compile(handle.read(), pythonrc, 'exec'), imported_objects) |
| 92 | except NameError: |
| 93 | pass |
95 | 94 | code.interact(local=imported_objects) |