diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index f86abe26f97ae2..df45764f047738 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -51,7 +51,7 @@ def __new__(mcls, name, bases, dct, *, source_date_epoch): class PyCompileTestsBase: def setUp(self): - self.directory = tempfile.mkdtemp() + self.directory = tempfile.mkdtemp(dir=os.getcwd()) self.source_path = os.path.join(self.directory, '_test.py') self.pyc_path = self.source_path + 'c' self.cache_path = importlib.util.cache_from_source(self.source_path) diff --git a/Misc/NEWS.d/next/macOS/2019-12-17-03-43-04.bpo-38295.hgDvlB.rst b/Misc/NEWS.d/next/macOS/2019-12-17-03-43-04.bpo-38295.hgDvlB.rst new file mode 100644 index 00000000000000..cc9ceb4cc50b30 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2019-12-17-03-43-04.bpo-38295.hgDvlB.rst @@ -0,0 +1 @@ +Prevent failure of test_relative_path in test_py_compile on macOS Catalina.