]> granicus.if.org Git - python/commitdiff
Make uuid test suite pass on this box by requesting output with LC_ALL=C.
authorGeorg Brandl <georg@python.org>
Thu, 27 Jul 2006 16:08:15 +0000 (16:08 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 27 Jul 2006 16:08:15 +0000 (16:08 +0000)
Lib/test/test_uuid.py
Lib/uuid.py

index fa7e3f61f85171e4d3b7ea9a6b3264f5709b1039..ad4d5fff36b2768a98c37e5ec751507910b4f6de 100644 (file)
@@ -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'):
index 3b590e84d53181d799b28e01f2d27052c819190e..11e0da3c9bedf8f5f26b0fab223b27832910aa74 100644 (file)
@@ -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: