Skip to content

Commit f77177c

Browse files
orivejjonathanslenders
authored andcommitted
Support user_ns arg for compatibility with start_ipython.
1 parent 895aa06 commit f77177c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ptpython/entry_points/run_ptipython.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import sys
2121

2222

23-
def run():
23+
def run(user_ns=None):
2424
a = docopt.docopt(__doc__)
2525

2626
vi_mode = bool(a['--vi'])
@@ -55,7 +55,8 @@ def run():
5555
# Create an empty namespace for this interactive shell. (If we don't do
5656
# that, all the variables from this function will become available in
5757
# the IPython shell.)
58-
user_ns = {}
58+
if user_ns is None:
59+
user_ns = {}
5960

6061
# Startup path
6162
startup_paths = []

0 commit comments

Comments
 (0)