Skip to content

Commit 3371074

Browse files
committed
Don't pretend INTERP-INFO atomic dir handling is general.
The INTERP-INFO atomic dir case is special since it contains just one file. Safe deletion in the general atomic dir case requires reader-writer file locks.
1 parent 00888cb commit 3371074

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

pex/cache/dirs.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import hashlib
99
import os
1010

11-
from pex.atomic_directory import atomic_directory
1211
from pex.common import pluralize, safe_rmtree
1312
from pex.compatibility import safe_commonpath, string
1413
from pex.enum import Enum
@@ -281,11 +280,6 @@ def __init__(
281280
# type: (...) -> None
282281
self.path = path
283282

284-
def safe_delete(self):
285-
with atomic_directory(self.path) as atomic_dir:
286-
if atomic_dir.is_finalized():
287-
safe_rmtree(self.path)
288-
289283
def __repr__(self):
290284
# type: () -> str
291285
return "{clazz}(path={path})".format(clazz=self.__class__.__name__, path=self.path)

pex/interpreter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ def create_interpreter(
11191119

11201120
cache_dir = InterpreterDir.create(binary)
11211121
if ignore_cached:
1122-
cache_dir.safe_delete()
1122+
safe_rmtree(cache_dir)
11231123
if os.path.isfile(cache_dir.interp_info_file):
11241124
try:
11251125
with open(cache_dir.interp_info_file, "rb") as fp:

0 commit comments

Comments
 (0)