Skip to content

Commit 961b945

Browse files
Fix handling of 'config file does not exist' when embedding ptpython.
1 parent d2e35e7 commit 961b945

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ptpython/repl.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,10 @@ def enter_to_continue() -> None:
433433
input("\nPress ENTER to continue...")
434434

435435
# Check whether this file exists.
436-
if not os.path.exists(config_file) and explicit_config_file:
437-
print("Impossible to read %r" % config_file)
438-
enter_to_continue()
436+
if not os.path.exists(config_file):
437+
if explicit_config_file:
438+
print(f"Impossible to read {config_file}")
439+
enter_to_continue()
439440
return
440441

441442
# Run the config file in an empty namespace.

0 commit comments

Comments
 (0)