We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ab13c9 commit 397ea0cCopy full SHA for 397ea0c
tools/please_pex/pex/pex_main.py
@@ -62,12 +62,12 @@ def explode_zip():
62
def pex_lockfile(basepath, uniquedir):
63
# Acquire the lockfile.
64
lockfile_path = os.path.join(basepath, '.lock-%s' % uniquedir)
65
- lockfile = open(lockfile_path, "a+")
66
- # Block until we can acquire the lockfile.
67
- portalocker.lock(lockfile, portalocker.LOCK_EX)
68
- lockfile.seek(0)
69
- yield lockfile
70
- portalocker.lock(lockfile, portalocker.LOCK_UN)
+ with open(lockfile_path, "a+") as lockfile:
+ # Block until we can acquire the lockfile.
+ portalocker.lock(lockfile, portalocker.LOCK_EX)
+ lockfile.seek(0)
+ yield lockfile
+ portalocker.lock(lockfile, portalocker.LOCK_UN)
71
72
@contextlib.contextmanager
73
def _explode_zip():
0 commit comments