[Python-checkins] r66809 - python/trunk/Lib/test/test_platform.py
hirokazu.yamamoto
python-checkins at python.org
Mon Oct 6 03:57:04 CEST 2008
Author: hirokazu.yamamoto
Date: Mon Oct 6 03:57:03 2008
New Revision: 66809
Log:
Added the patch for issue3762.
Modified:
python/trunk/Lib/test/test_platform.py
Modified: python/trunk/Lib/test/test_platform.py
==============================================================================
--- python/trunk/Lib/test/test_platform.py (original)
+++ python/trunk/Lib/test/test_platform.py Mon Oct 6 03:57:03 2008
@@ -2,6 +2,7 @@
import os
import unittest
import platform
+import subprocess
from test import test_support
@@ -9,6 +10,20 @@
def test_architecture(self):
res = platform.architecture()
+ if hasattr(os, "symlink"):
+ def test_architecture_via_symlink(self): # issue3762
+ def get(python):
+ cmd = [python, '-c',
+ '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)
+ try:
+ self.assertEqual(get(sys.executable), get(symlink))
+ finally:
+ os.remove(symlink)
+
def test_machine(self):
res = platform.machine()
More information about the Python-checkins
mailing list