From 82328ad1edcec728750817d14132a256333f1802 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Sat, 12 May 2018 08:42:07 -0700 Subject: [PATCH] don't hard fail on warning suppression --- flask_common.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flask_common.py b/flask_common.py index 673b055..22fd194 100644 --- a/flask_common.py +++ b/flask_common.py @@ -9,10 +9,12 @@ from gunicorn.app.base import Application from whitenoise import WhiteNoise from flask_cache import Cache -import warnings -from flask.exthook import ExtDeprecationWarning - -warnings.simplefilter('ignore', ExtDeprecationWarning) +try: + from flask.exthook import ExtDeprecationWarning + import warnings + warnings.simplefilter('ignore', ExtDeprecationWarning) +except ImportError: + pass # DeprecationWarning only relevant to Flask<1.0 # Find the stack on which we want to store the database connection.