Fix unlink incompatibility for real
This commit is contained in:
parent
8ab5de6b19
commit
a8fa8fd11c
1 changed files with 2 additions and 6 deletions
|
|
@ -77,9 +77,7 @@ def serve() -> None:
|
||||||
finally:
|
finally:
|
||||||
if args.file_name.endswith(".ipynb"):
|
if args.file_name.endswith(".ipynb"):
|
||||||
try:
|
try:
|
||||||
Path(get_script_name_of_notebook(args.file_name)).unlink(
|
Path(get_script_name_of_notebook(args.file_name)).unlink()
|
||||||
missing_ok=True
|
|
||||||
)
|
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# missing_ok only exists >= Python 3.8
|
# missing_ok only exists >= Python 3.8
|
||||||
pass
|
pass
|
||||||
|
|
@ -129,9 +127,7 @@ def serve() -> None:
|
||||||
restart_handler.stop_server()
|
restart_handler.stop_server()
|
||||||
if args.file_name.endswith(".ipynb"):
|
if args.file_name.endswith(".ipynb"):
|
||||||
try:
|
try:
|
||||||
Path(get_script_name_of_notebook(args.file_name)).unlink(
|
Path(get_script_name_of_notebook(args.file_name)).unlink()
|
||||||
missing_ok=True
|
|
||||||
)
|
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# missing_ok only exists >= Python 3.8
|
# missing_ok only exists >= Python 3.8
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue