summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sysconfig.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-11 00:05:17 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-11 00:05:17 (GMT)
commita470738b7bf68c3f9bd4063cbef5c0db66bc04a8 (patch)
tree3801b8607241aa2f3dfd0a42dad49b7a8f6a5287 /Lib/test/test_sysconfig.py
parent0f64b0b9a350d7ac34836d5cb858de4135d8b0e4 (diff)
downloadcpython-a470738b7bf68c3f9bd4063cbef5c0db66bc04a8.zip
cpython-a470738b7bf68c3f9bd4063cbef5c0db66bc04a8.tar.gz
cpython-a470738b7bf68c3f9bd4063cbef5c0db66bc04a8.tar.bz2
Merged revisions 78828 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78828 | florent.xicluna | 2010-03-11 00:58:42 +0100 (jeu, 11 mar 2010) | 2 lines Issue #7880: Fix sysconfig when the python executable is a symbolic link. ........
Diffstat (limited to 'Lib/test/test_sysconfig.py')
-rw-r--r--Lib/test/test_sysconfig.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 5b50901..aa2c514 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -8,9 +8,10 @@ import unittest
import sys
import test
import os
+import subprocess
from copy import copy, deepcopy
-from test.support import run_unittest, TESTFN
+from test.support import run_unittest, TESTFN, unlink, get_attribute
import sysconfig
from sysconfig import (get_paths, get_platform, get_config_vars,
@@ -237,6 +238,23 @@ class TestSysConfig(unittest.TestCase):
'posix_prefix', 'posix_user')
self.assertEquals(get_scheme_names(), wanted)
+ def test_symlink(self):
+ # Issue 7880
+ symlink = get_attribute(os, "symlink")
+ def get(python):
+ cmd = [python, '-c',
+ 'import sysconfig; print sysconfig.get_platform()']
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ return p.communicate()
+ real = os.path.realpath(sys.executable)
+ link = os.path.abspath(TESTFN)
+ symlink(real, link)
+ try:
+ self.assertEqual(get(real), get(link))
+ finally:
+ unlink(link)
+
def test_main():
run_unittest(TestSysConfig)