Fix unlink incompatibility for real

This commit is contained in:
Andras Schmelczer 2022-07-29 13:36:28 +02:00
parent 8ab5de6b19
commit a8fa8fd11c
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E

View file

@ -77,9 +77,7 @@ def serve() -> None:
finally:
if args.file_name.endswith(".ipynb"):
try:
Path(get_script_name_of_notebook(args.file_name)).unlink(
missing_ok=True
)
Path(get_script_name_of_notebook(args.file_name)).unlink()
except FileNotFoundError:
# missing_ok only exists >= Python 3.8
pass
@ -129,9 +127,7 @@ def serve() -> None:
restart_handler.stop_server()
if args.file_name.endswith(".ipynb"):
try:
Path(get_script_name_of_notebook(args.file_name)).unlink(
missing_ok=True
)
Path(get_script_name_of_notebook(args.file_name)).unlink()
except FileNotFoundError:
# missing_ok only exists >= Python 3.8
pass