Skip to content

Commit

Permalink
Merge pull request #341 from hbusul/issue-313
Browse files Browse the repository at this point in the history
#313 don't use werkzeug, flask 2.0.0 and use Response instead of BaseResponse. Contrib: hbusul reviewer: j5awry
  • Loading branch information
j5awry authored Jul 5, 2021
2 parents af807aa + acc4dc9 commit 8a01bc7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 7 additions & 1 deletion flask_restx/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@
NotAcceptable,
InternalServerError,
)
from werkzeug.wrappers import BaseResponse

from werkzeug import __version__ as werkzeug_version

if werkzeug_version.split('.')[0] >= '2':
from werkzeug.wrappers import Response as BaseResponse
else:
from werkzeug.wrappers import BaseResponse

from . import apidoc
from .mask import ParseError, MaskError
Expand Down
7 changes: 6 additions & 1 deletion flask_restx/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

from flask import request
from flask.views import MethodView
from werkzeug.wrappers import BaseResponse
from werkzeug import __version__ as werkzeug_version

if werkzeug_version.split('.')[0] >= '2':
from werkzeug.wrappers import Response as BaseResponse
else:
from werkzeug.wrappers import BaseResponse

from .model import ModelBase

Expand Down
4 changes: 2 additions & 2 deletions requirements/install.pip
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
aniso8601==8.0.0; python_version < '3.5'
aniso8601>=0.82; python_version >= '3.5'
jsonschema
Flask>=0.8, <2.0.0
werkzeug <2.0.0
Flask>=0.8, !=2.0.0
werkzeug !=2.0.0
pytz
six>=1.3.0
enum34; python_version < '3.4'

0 comments on commit 8a01bc7

Please sign in to comment.