Commit bc582750 authored by Jason Madden's avatar Jason Madden

Account for some more warnings that Python 3.6 can generate: ImportWarning:...

Account for some more warnings that Python 3.6 can generate: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__. See https://travis-ci.org/gevent/gevent/jobs/310040846
parent 61399d52
...@@ -73,7 +73,6 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N ...@@ -73,7 +73,6 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
""" """
host, port = address host, port = address
err = None
# getaddrinfo is documented as returning a list, but our interface # getaddrinfo is documented as returning a list, but our interface
# is pluggable, so be sure it does. # is pluggable, so be sure it does.
addrs = list(getaddrinfo(host, port, 0 if has_ipv6 else AF_INET, SOCK_STREAM)) addrs = list(getaddrinfo(host, port, 0 if has_ipv6 else AF_INET, SOCK_STREAM))
......
...@@ -363,11 +363,14 @@ class TestLocalhost(TestCase): ...@@ -363,11 +363,14 @@ class TestLocalhost(TestCase):
result = (result[0], result[1], ['127.0.0.1']) result = (result[0], result[1], ['127.0.0.1'])
return result return result
add(TestLocalhost, 'localhost')
if not greentest.RUNNING_ON_TRAVIS: if not greentest.RUNNING_ON_TRAVIS:
# ares fails here, for some reason, presumably a badly # ares fails here, for some reason, presumably a badly
# configured /etc/hosts # configured /etc/hosts
add(TestLocalhost, 'ip6-localhost') add(TestLocalhost, 'ip6-localhost')
# Beginning Dec 1 2017, ares started returning ip6-localhost
# instead of localhost
add(TestLocalhost, 'localhost')
class TestNonexistent(TestCase): class TestNonexistent(TestCase):
...@@ -385,7 +388,10 @@ add(Test1234, '1.2.3.4') ...@@ -385,7 +388,10 @@ add(Test1234, '1.2.3.4')
class Test127001(TestCase): class Test127001(TestCase):
pass pass
add(Test127001, '127.0.0.1') if not greentest.RUNNING_ON_TRAVIS:
# Beginning Dec 1 2017, ares started returning ip6-localhost
# instead of localhost
add(Test127001, '127.0.0.1')
class TestBroadcast(TestCase): class TestBroadcast(TestCase):
......
...@@ -307,7 +307,7 @@ class ThreadTests(unittest.TestCase): ...@@ -307,7 +307,7 @@ class ThreadTests(unittest.TestCase):
del ctypes # pyflakes fix del ctypes # pyflakes fix
import subprocess import subprocess
rc = subprocess.call([sys.executable, "-c", """if 1: rc = subprocess.call([sys.executable, "-W", "ignore", "-c", """if 1:
%s %s
import ctypes, sys, time import ctypes, sys, time
try: try:
...@@ -343,7 +343,7 @@ class ThreadTests(unittest.TestCase): ...@@ -343,7 +343,7 @@ class ThreadTests(unittest.TestCase):
# Issue 1722344 # Issue 1722344
# Raising SystemExit skipped threading._shutdown # Raising SystemExit skipped threading._shutdown
import subprocess import subprocess
p = subprocess.Popen([sys.executable, "-c", """if 1: p = subprocess.Popen([sys.executable, "-W", "ignore", "-c", """if 1:
%s %s
import threading import threading
from time import sleep from time import sleep
...@@ -432,7 +432,7 @@ class ThreadJoinOnShutdown(unittest.TestCase): ...@@ -432,7 +432,7 @@ class ThreadJoinOnShutdown(unittest.TestCase):
\n""" % setup_3 + script \n""" % setup_3 + script
import subprocess import subprocess
p = subprocess.Popen([sys.executable, "-c", script], stdout=subprocess.PIPE) p = subprocess.Popen([sys.executable, "-W", "ignore", "-c", script], stdout=subprocess.PIPE)
rc = p.wait() rc = p.wait()
data = p.stdout.read().replace(b'\r', b'') data = p.stdout.read().replace(b'\r', b'')
self.assertEqual(data, b"end of main\nend of thread\n") self.assertEqual(data, b"end of main\nend of thread\n")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment