mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-38234: Fix test_embed pathconfig tests (GH-16390)
bpo-38234: On macOS and FreeBSD, the temporary directory can be symbolic link. For example, /tmp can be a symbolic link to /var/tmp. Call realpath() to resolve all symbolic links.
This commit is contained in:
parent
c64a1a61e6
commit
00508a7407
1 changed files with 5 additions and 0 deletions
|
@ -1042,6 +1042,11 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
def tmpdir_with_python(self):
|
||||
# Temporary directory with a copy of the Python program
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
# bpo-38234: On macOS and FreeBSD, the temporary directory
|
||||
# can be symbolic link. For example, /tmp can be a symbolic link
|
||||
# to /var/tmp. Call realpath() to resolve all symbolic links.
|
||||
tmpdir = os.path.realpath(tmpdir)
|
||||
|
||||
if MS_WINDOWS:
|
||||
# Copy pythonXY.dll (or pythonXY_d.dll)
|
||||
ver = sys.version_info
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue