]> granicus.if.org Git - python/commitdiff
merge 3.2
authorBenjamin Peterson <benjamin@python.org>
Mon, 3 Nov 2014 20:11:53 +0000 (15:11 -0500)
committerBenjamin Peterson <benjamin@python.org>
Mon, 3 Nov 2014 20:11:53 +0000 (15:11 -0500)
1  2 
Lib/test/test_socket.py

index 450aee1d43343f7d56169ed2a0b0b8531f84f2e9,ea5241978328f7f92bf6a0f690e3ec14a43fff46..ee4aea37faffdd5c6b4ea764e650663f5c72caa5
@@@ -1181,16 -773,12 +1181,17 @@@ class GeneralModuleTests(unittest.TestC
      @unittest.skipUnless(support.is_resource_enabled('network'),
                           'network is not enabled')
      def test_idna(self):
 -        support.requires('network')
 +        # Check for internet access before running test (issue #12804).
 +        try:
 +            socket.gethostbyname('python.org')
 +        except socket.gaierror as e:
 +            if e.errno == socket.EAI_NODATA:
 +                self.skipTest('internet access required for this test')
          # these should all be successful
-         socket.gethostbyname('испытание.python.org')
-         socket.gethostbyname_ex('испытание.python.org')
-         socket.getaddrinfo('испытание.python.org',0,socket.AF_UNSPEC,socket.SOCK_STREAM)
+         domain = 'испытание.pythontest.net'
+         socket.gethostbyname(domain)
+         socket.gethostbyname_ex(domain)
+         socket.getaddrinfo(domain,0,socket.AF_UNSPEC,socket.SOCK_STREAM)
          # this may not work if the forward lookup choses the IPv6 address, as that doesn't
          # have a reverse entry yet
          # socket.gethostbyaddr('испытание.python.org')