From 8ea227a0e54d78cef29b8f89f3216fd9bde2ff9c Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Wed, 26 Aug 2020 13:09:41 -0700 Subject: [PATCH] Suppress CryptographyDeprecationWarnings Change-Id: Id123fb0f9173cf75916984d85bcf8c2d5eefaec2 --- swift/__init__.py | 7 +++++++ test/__init__.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/swift/__init__.py b/swift/__init__.py index f9f0931324..3b2bb6371e 100644 --- a/swift/__init__.py +++ b/swift/__init__.py @@ -16,6 +16,7 @@ import os import sys import gettext +import warnings import pkg_resources @@ -74,3 +75,9 @@ if (3, 0) <= sys.version_info[:2] <= (3, 5): json.loads = JsonLoadsPatcher(json.loads) del JsonLoadsPatcher + + +warnings.filterwarnings('ignore', module='cryptography', message=( + 'Python 2 is no longer supported by the Python core team. ' + 'Support for it is now deprecated in cryptography, ' + 'and will be removed in a future release.')) diff --git a/test/__init__.py b/test/__init__.py index 51e3aa9d82..6d7351955b 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -37,6 +37,12 @@ except ImportError: return result return result[:_MAX_LENGTH] + ' [truncated]...' +import warnings +warnings.filterwarnings('ignore', module='cryptography', message=( + 'Python 2 is no longer supported by the Python core team. ' + 'Support for it is now deprecated in cryptography, ' + 'and will be removed in a future release.')) + from eventlet.green import socket # make unittests pass on all locale