Downstream packages (e.g. django-extension's shell_plus) use ptpython.repl.run_config() to use the system's optional ptpython config files. The result is users can be surprised by run_config() interrupting the terminal for a config file they didn't explicitly request: ptpython had the default.
Current behavior
run_config() specifies a default configuration file, which may or may not exist on systems.
ptpython.repl.embed() runs flawlessly if run_config() returns an empty value.
What this change does
Adds interrupt_if_not_found with default of False.
Other options
Do nothing, accept current behavior
interrupt_if_not_found default to True
This means downstream packages will need to check ptpython version and expliclitly opt in via interrupt_if_not_found=False.
551: Only interrupt if explicit config_file passed
Resolves #549
Problem
Downstream packages (e.g. django-extension's
shell_plus
) useptpython.repl.run_config()
to use the system's optional ptpython config files. The result is users can be surprised byrun_config()
interrupting the terminal for a config file they didn't explicitly request: ptpython had the default.Current behavior
run_config()
specifies a default configuration file, which may or may not exist on systems.ptpython.repl.embed()
runs flawlessly ifrun_config()
returns an empty value.What this change does
Adds
interrupt_if_not_found
with default of False.Other options
interrupt_if_not_found
default toTrue
This means downstream packages will need to check
ptpython
version and expliclitly opt in viainterrupt_if_not_found=False
.551: Only interrupt if explicit
config_file
passedRemove default
config_file
param._Return
None
if noconfig_file
passed._