From 18c4e8734c7d817163e2c6564eedc246a2c9aa58 Mon Sep 17 00:00:00 2001 From: Hirokazu Yamamoto Date: Mon, 6 Oct 2008 02:41:59 +0000 Subject: [PATCH] More strict test. Consider the case sys.executable itself is symlink. --- Lib/test/test_platform.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 5024737db95..2fa13096eea 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()