From: Hirokazu Yamamoto Date: Mon, 6 Oct 2008 02:41:59 +0000 (+0000) Subject: More strict test. Consider the case sys.executable itself is symlink. X-Git-Tag: v2.7a1~2767 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18c4e8734c7d817163e2c6564eedc246a2c9aa58;p=thirdparty%2FPython%2Fcpython.git More strict test. Consider the case sys.executable itself is symlink. --- diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 5024737db95a..2fa13096eea0 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -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()