Skip to content

Commit 7b8d03a

Browse files
committed
Remove os.path from pkg_utils.py
1 parent 3f86b90 commit 7b8d03a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pytensor/misc/pkl_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
unit tests or regression tests.
66
"""
77

8-
import os
98
import pickle
109
import sys
1110
import tempfile
1211
import zipfile
1312
from collections import defaultdict
1413
from contextlib import closing
1514
from io import BytesIO
15+
from pathlib import Path
1616
from pickle import HIGHEST_PROTOCOL
1717

1818
import numpy as np
@@ -298,5 +298,4 @@ def zipadd(func, zip_file, name):
298298
func(temp_file)
299299
temp_file.close()
300300
zip_file.write(temp_file.name, arcname=name)
301-
if os.path.isfile(temp_file.name):
302-
os.remove(temp_file.name)
301+
Path(temp_file.name).unlink(missing_ok=True)

0 commit comments

Comments
 (0)