Skip to content

Commit

Permalink
Fix handling of 'config file does not exist' when embedding ptpython.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanslenders committed Dec 13, 2023
1 parent d2e35e7 commit 961b945
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ptpython/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,10 @@ def enter_to_continue() -> None:
input("\nPress ENTER to continue...")

# Check whether this file exists.
if not os.path.exists(config_file) and explicit_config_file:
print("Impossible to read %r" % config_file)
enter_to_continue()
if not os.path.exists(config_file):
if explicit_config_file:
print(f"Impossible to read {config_file}")
enter_to_continue()
return

# Run the config file in an empty namespace.
Expand Down

0 comments on commit 961b945

Please sign in to comment.