Skip to content

Commit da5d9e6

Browse files
matthiasdienerinducer
authored andcommitted
PersistentDict: replace _make_dir_recursively
also removes update_checksum, which appears to be unused
1 parent 78bba69 commit da5d9e6

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

pytools/persistent_dict.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,6 @@
7070
"""
7171

7272

73-
def _make_dir_recursively(dir_):
74-
try:
75-
os.makedirs(dir_)
76-
except OSError as ex:
77-
from errno import EEXIST
78-
if ex.errno != EEXIST:
79-
raise
80-
81-
82-
def update_checksum(checksum, obj):
83-
if isinstance(obj, str):
84-
checksum.update(obj.encode("utf8"))
85-
else:
86-
checksum.update(obj)
87-
88-
8973
# {{{ cleanup managers
9074

9175
class CleanupBase:
@@ -633,7 +617,7 @@ def _lock_file(self, hexdigest_key):
633617
return join(self.container_dir, str(hexdigest_key) + ".lock")
634618

635619
def _make_container_dir(self):
636-
_make_dir_recursively(self.container_dir)
620+
os.makedirs(self.container_dir, exist_ok=True)
637621

638622
def _collision_check(self, key, stored_key, _stacklevel):
639623
if stored_key != key:

0 commit comments

Comments
 (0)