From e99f0aeac60bda47bdb550c62205961613fb05c2 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Wed, 29 Apr 2020 14:10:01 +1000 Subject: [PATCH] Add deprecation warning when running Python 2 [#5598]. --- mediagoblin/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mediagoblin/__init__.py b/mediagoblin/__init__.py index 88dedd28..d4ecd745 100644 --- a/mediagoblin/__init__.py +++ b/mediagoblin/__init__.py @@ -14,4 +14,16 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import warnings + +import six + from mediagoblin._version import __version__ + + +if six.PY2: + warnings.warn( + "MediaGoblin's Python 2 support will be removed in the next" + " release. Please consider switching to Python 3.", + DeprecationWarning, + ) -- 2.25.1