Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
a5b9096e
Commit
a5b9096e
authored
Jul 23, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cares tests on py2
parent
2373a502
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
src/gevent/resolver/dnspython.py
src/gevent/resolver/dnspython.py
+1
-1
src/gevent/tests/test__socket_dns6.py
src/gevent/tests/test__socket_dns6.py
+14
-1
No files found.
src/gevent/resolver/dnspython.py
View file @
a5b9096e
...
...
@@ -112,7 +112,7 @@ def _patch_dns():
def
extra_all
(
mod_name
):
return
extras
.
get
(
mod_name
,
())
def
after_import_hook
(
dns
):
# pylint
;
disable=redefined-outer-name
def
after_import_hook
(
dns
):
# pylint
:
disable=redefined-outer-name
# Runs while still in the original patching scope.
# The dns.rdata:get_rdata_class() function tries to
# dynamically import modules using __import__ and then walk
...
...
src/gevent/tests/test__socket_dns6.py
View file @
a5b9096e
...
...
@@ -10,8 +10,9 @@ from gevent.tests.test__socket_dns import TestCase, add
from
gevent.testing.sysinfo
import
OSX
from
gevent.testing.sysinfo
import
RESOLVER_DNSPYTHON
from
gevent.testing.sysinfo
import
RESOLVER_ARES
from
gevent.testing.sysinfo
import
PYPY
from
gevent.testing.sysinfo
import
PY2
# We can't control the DNS servers on CI (or in general...)
# for the system. This works best with the google DNS servers
...
...
@@ -45,6 +46,18 @@ class Test6(TestCase):
# of the system and ares. They don't match exactly.
return
()
if
RESOLVER_ARES
and
PY2
:
def
_normalize_result_getnameinfo
(
self
,
result
):
# Beginning 2020-07-23,
# c-ares returns a scope id on the result:
# ('2001:470:1:18::115%0', 'http')
# The standard library does not (on linux or os x).
# I've only seen '%0', so only remove that
ipaddr
,
service
=
result
if
ipaddr
.
endswith
(
'%0'
):
ipaddr
=
ipaddr
[:
-
2
]
return
(
ipaddr
,
service
)
if
not
OSX
and
RESOLVER_DNSPYTHON
:
# It raises gaierror instead of socket.error,
# which is not great and leads to failures.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment