ignore warnings from pyopenssl
@@ -28,21 +28,11 @@ except (NameError, KeyError):
# Uncomment the following line to treat all DeprecationWarnings as
# exceptions
#
-# These warnings can be removed once pyopenssl 1.7.20+ is out.
-_warnings = {
- (2, 7): set([
- r"DeprecationWarning: OpenSSL.rand is deprecated - you should use os.urandom instead", ]),
- (3, 4): set([
- r"DeprecationWarning: OpenSSL.rand is deprecated - you should use os.urandom instead", ]),
- (3, 5): set([
- r"DeprecationWarning: OpenSSL.rand is deprecated - you should use os.urandom instead", ]),
- (3, 6): set([
- r"DeprecationWarning: OpenSSL.rand is deprecated - you should use os.urandom instead", ])}
-
+# The workaround can be removed once pyopenssl 1.7.20+ is out.
import astropy
if int(astropy.__version__[0]) > 1:
# The warnings_to_ignore_by_pyver parameter was added in astropy 2.0
- enable_deprecations_as_exceptions(warnings_to_ignore_by_pyver=_warnings)
+ enable_deprecations_as_exceptions(modules_to_ignore_on_import=['requests'])
# This is to figure out the affiliated package version, rather than
# using Astropy's
