Make werkzeug.wsgi middleware imports the fallback option

This change swaps the attempted import order around so that the
newer imports are tried first.
This commit is contained in:
Jason Phan 2020-12-27 16:16:26 +00:00 committed by Drew DeVault
parent cb60540946
commit e1e54174ec
2 changed files with 4 additions and 4 deletions

View File

@ -25,9 +25,9 @@ def configure_static_arguments(parser):
def configure_static_serving(app, args):
if args.static and app.static_folder:
try:
from werkzeug.wsgi import SharedDataMiddleware
except ImportError:
from werkzeug.middleware.shared_data import SharedDataMiddleware
except ImportError:
from werkzeug.wsgi import SharedDataMiddleware
print("Serving static assets from: {}".format(app.static_folder))
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {

View File

@ -18,9 +18,9 @@ from werkzeug.local import LocalProxy
from werkzeug.routing import UnicodeConverter
from werkzeug.urls import url_quote
try:
from werkzeug.wsgi import DispatcherMiddleware
except ImportError:
from werkzeug.middleware.dispatcher import DispatcherMiddleware
except ImportError:
from werkzeug.wsgi import DispatcherMiddleware
import binascii
import bleach
import decimal