Skip to content

Commit

Permalink
Pin dnspython < 2 for now; fully fixing it is going to be a bit invol…
Browse files Browse the repository at this point in the history
…ved.
  • Loading branch information
jamadden committed Jul 22, 2020
1 parent 3a5b08a commit 401729c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/changes/1661.bugfix
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
Fix compatibility with dnspython 2.

.. caution:: This currently means that it can be imported. But it
cannot yet be used. gevent has a pinned dependency on
dnspython < 2 for now.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
## Extras

EXTRA_DNSPYTHON = [
'dnspython >= 1.16.0',
'dnspython >= 1.16.0, < 2.0',
'idna',
]
EXTRA_EVENTS = [
Expand Down
3 changes: 1 addition & 2 deletions src/gevent/resolver/dnspython.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _patch_dns():
def extra_all(mod_name):
return extras.get(mod_name, ())

def after_import_hook(dns):
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
Expand Down Expand Up @@ -150,7 +150,6 @@ def _no_dynamic_imports(name):

top.rdata.__import__ = _no_dynamic_imports


return top

dns = _patch_dns()
Expand Down

0 comments on commit 401729c

Please sign in to comment.