summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sysconfig.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-06 11:13:25 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-06 11:13:25 (GMT)
commit2a23adf4405bcd903aabf445dd54867d95f494a1 (patch)
treefc4c823138cb505c180873976bc0a41ac3a1f6d5 /Lib/test/test_sysconfig.py
parentef920d6d5e38cebd51b17001d614b55b1c468041 (diff)
downloadcpython-2a23adf4405bcd903aabf445dd54867d95f494a1.zip
cpython-2a23adf4405bcd903aabf445dd54867d95f494a1.tar.gz
cpython-2a23adf4405bcd903aabf445dd54867d95f494a1.tar.bz2
Use support.change_cwd() in tests.
Diffstat (limited to 'Lib/test/test_sysconfig.py')
-rw-r--r--Lib/test/test_sysconfig.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 804c446..8ed729a 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -6,7 +6,7 @@ import shutil
from copy import copy
from test.support import (run_unittest, TESTFN, unlink, check_warnings,
- captured_stdout, skip_unless_symlink)
+ captured_stdout, skip_unless_symlink, change_cwd)
import sysconfig
from sysconfig import (get_paths, get_platform, get_config_vars,
@@ -361,12 +361,8 @@ class TestSysConfig(unittest.TestCase):
# srcdir should be independent of the current working directory
# See Issues #15322, #15364.
srcdir = sysconfig.get_config_var('srcdir')
- cwd = os.getcwd()
- try:
- os.chdir('..')
+ with change_cwd(os.pardir):
srcdir2 = sysconfig.get_config_var('srcdir')
- finally:
- os.chdir(cwd)
self.assertEqual(srcdir, srcdir2)
@unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,