Skip to content

Commit bc50874

Browse files
tpoliawjonathanslenders
authored andcommitted
Use __main__.__dict__ for locals when running from command line
Fixes issues prompt-toolkit#148 and prompt-toolkit#201
1 parent 70fcb86 commit bc50874

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ptpython/entry_points/run_ptpython.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ def configure(repl):
6464
if os.path.exists(path):
6565
run_config(repl, path)
6666

67+
import __main__
6768
embed(vi_mode=vi_mode,
6869
history_filename=os.path.join(config_dir, 'history'),
6970
configure=configure,
71+
locals=__main__.__dict__,
7072
startup_paths=startup_paths,
7173
title='Python REPL (ptpython)')
7274

0 commit comments

Comments
 (0)