Skip to content

Commit

Permalink
Merge pull request #24 from YoApp/master
Browse files Browse the repository at this point in the history
Fix version comparison of Werkzeug
  • Loading branch information
alisaifee committed Jan 30, 2015
2 parents a2eb928 + 8f5fdcb commit f2c44a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flask_limiter/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
errors and exceptions
"""

from distutils.version import LooseVersion
from werkzeug.exceptions import HTTPException

def _patch_werkzeug():
import pkg_resources
if pkg_resources.get_distribution("werkzeug").version < "0.9":
werkzeug_version = pkg_resources.get_distribution("werkzeug").version
if LooseVersion(werkzeug_version) < LooseVersion("0.9"):
# sorry, for touching your internals :).
import werkzeug._internal # pragma: no cover
werkzeug._internal.HTTP_STATUS_CODES[429] = 'Too Many Requests' # pragma: no cover
Expand Down

0 comments on commit f2c44a8

Please sign in to comment.