From da8018a670df76acc09314ddf2f36f9b33aceafa Mon Sep 17 00:00:00 2001 From: Jaakko Lappalainen Date: Fri, 20 Mar 2020 14:13:24 +0000 Subject: [PATCH] handle werkzeug 1.0.x import --- flask_restplus/api.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flask_restplus/api.py b/flask_restplus/api.py index b5433ce3..dc276618 100644 --- a/flask_restplus/api.py +++ b/flask_restplus/api.py @@ -25,7 +25,13 @@ from jsonschema import RefResolver -from werkzeug import cached_property + +try: + from werkzeug import cached_property +except ImportError: + # Handle werkzeug 1.0.x + from werkzeug.utils import cached_property + from werkzeug.datastructures import Headers from werkzeug.exceptions import HTTPException, MethodNotAllowed, NotFound, NotAcceptable, InternalServerError from werkzeug.wrappers import BaseResponse