]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
More strict test. Consider the case sys.executable itself is symlink.
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Mon, 6 Oct 2008 02:41:59 +0000 (02:41 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Mon, 6 Oct 2008 02:41:59 +0000 (02:41 +0000)
Lib/test/test_platform.py

index 5024737db95a573beb401b7188a2ad155d2eb78a..2fa13096eea03a3e9e4135a52528449e1f926e15 100644 (file)
@@ -17,12 +17,13 @@ class PlatformTest(unittest.TestCase):
                     'import platform; print platform.architecture()']
                 p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
                 return p.communicate()
-            symlink = os.path.abspath(test_support.TESTFN)
-            os.symlink(sys.executable, symlink)
+            real = os.path.realpath(sys.executable)
+            link = os.path.abspath(test_support.TESTFN)
+            os.symlink(real, link)
             try:
-                self.assertEqual(get(sys.executable), get(symlink))
+                self.assertEqual(get(real), get(link))
             finally:
-                os.remove(symlink)
+                os.remove(link)
 
     def test_machine(self):
         res = platform.machine()