Skip to content

Commit

Permalink
Silence the dnspython warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Mar 27, 2019
1 parent a367d91 commit e713954
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gevent/testing/testrunner.py
Expand Up @@ -353,7 +353,10 @@ def print_list(lst):
log(' - %s', name)

def _setup_environ(debug=False):
if 'PYTHONWARNINGS' not in os.environ and not sys.warnoptions:
if ('PYTHONWARNINGS' not in os.environ
and (not sys.warnoptions
# Python 3.7 goes from [] to ['default'] for nothing
or sys.warnoptions == ['default'])):

# action:message:category:module:line
os.environ['PYTHONWARNINGS'] = ','.join([
Expand All @@ -373,6 +376,10 @@ def _setup_environ(debug=False):
'ignore:::importlib._bootstrap_external:',
# importing ABCs from collections, not collections.abc
'ignore:::pkg_resources._vendor.pyparsing:',
'ignore:::dns.namedict:',
# dns.hash itself is being deprecated, importing it raises the warning;
# we don't import it, but dnspython still does
'ignore:::dns.hash:',
])

if 'PYTHONFAULTHANDLER' not in os.environ:
Expand Down

0 comments on commit e713954

Please sign in to comment.