summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-07-27 16:08:15 (GMT)
committerGeorg Brandl <georg@python.org>2006-07-27 16:08:15 (GMT)
commit75a832d4e776ae6ee4aca1443cd595420b551b47 (patch)
tree261078333f151b5b672b23a95da6b0c8c169341c /Lib
parent6cea7d74ade5934e4bea810d37f2906498b6a1d9 (diff)
downloadcpython-75a832d4e776ae6ee4aca1443cd595420b551b47.zip
cpython-75a832d4e776ae6ee4aca1443cd595420b551b47.tar.gz
cpython-75a832d4e776ae6ee4aca1443cd595420b551b47.tar.bz2
Make uuid test suite pass on this box by requesting output with LC_ALL=C.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_uuid.py8
-rw-r--r--Lib/uuid.py5
2 files changed, 10 insertions, 3 deletions
diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py
index fa7e3f6..ad4d5ff 100644
--- a/Lib/test/test_uuid.py
+++ b/Lib/test/test_uuid.py
@@ -288,12 +288,16 @@ class TestUUID(TestCase):
def test_ifconfig_getnode(self):
import os
if os.name == 'posix':
- self.check_node(uuid._ifconfig_getnode(), 'ifconfig')
+ node = uuid._ifconfig_getnode()
+ if node is not None:
+ self.check_node(node, 'ifconfig')
def test_ipconfig_getnode(self):
import os
if os.name == 'nt':
- self.check_node(uuid._ipconfig_getnode(), 'ipconfig')
+ node = uuid._ipconfig_getnode()
+ if node is not None:
+ self.check_node(node, 'ipconfig')
def test_netbios_getnode(self):
if importable('win32wnet') and importable('netbios'):
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 3b590e8..11e0da3 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -276,7 +276,10 @@ def _ifconfig_getnode():
import os
for dir in ['', '/sbin/', '/usr/sbin']:
try:
- pipe = os.popen(os.path.join(dir, 'ifconfig'))
+ # LC_ALL to get English output, 2>/dev/null to
+ # prevent output on stderr
+ cmd = 'LC_ALL=C %s 2>/dev/null' % os.path.join(dir, 'ifconfig')
+ pipe = os.popen(cmd)
except IOError:
continue
for line in pipe: