Initialize cache directory in isolation
Creating and initializing the cache directory is interruptible; this avoids a pathological case where interrupting a cache write can cause the cache directory to never be properly initialized with its supporting files. Unify `Cache.mkdir` with `Cache.set` while I'm here so the former also properly initializes the cache directory. Closes #12167.
This commit is contained in:
@@ -1731,8 +1731,8 @@ class TestEarlyRewriteBailout:
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
os.chdir(d)
|
||||
with tempfile.TemporaryDirectory() as newpath:
|
||||
os.chdir(newpath)
|
||||
""",
|
||||
"test_test.py": """\
|
||||
def test():
|
||||
|
||||
Reference in New Issue
Block a user