prompt-toolkit / ptpython

A better Python REPL
BSD 3-Clause "New" or "Revised" License
5.23k stars 281 forks source link

[RFC] `run_config()`: skip interrupt if `config_file` not found #550

Closed tony closed 1 year ago

tony commented 1 year ago

Resolves #549

Problem

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

tony commented 1 year ago

Resolved via merge of #551 in d25e678.

If there's any more commentary on this please feel free to ping / create a separate issue, and reference this issue and/or #549.