support for werkzeug 0.8 (Python2-only)
This commit is contained in:
parent
312578457b
commit
e14a04ab6c
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
|
||||||
|
import pkg_resources
|
||||||
|
werkzeug = pkg_resources.get_distribution("werkzeug")
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
import hashlib
|
import hashlib
|
||||||
@ -91,6 +94,10 @@ class Bloomfilter:
|
|||||||
|
|
||||||
class JSONRequest(Request):
|
class JSONRequest(Request):
|
||||||
|
|
||||||
|
if werkzeug.version.startswith("0.8"):
|
||||||
|
def get_data(self):
|
||||||
|
return self.data.decode('utf-8')
|
||||||
|
|
||||||
def get_json(self):
|
def get_json(self):
|
||||||
try:
|
try:
|
||||||
return json.loads(self.get_data().decode('utf-8'))
|
return json.loads(self.get_data().decode('utf-8'))
|
||||||
|
6
setup.py
6
setup.py
@ -5,13 +5,15 @@ import sys
|
|||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
requires = ['werkzeug>=0.9', 'itsdangerous', 'misaka', 'html5lib']
|
requires = ['itsdangerous', 'misaka', 'html5lib']
|
||||||
|
|
||||||
if (3, 0) <= sys.version_info < (3, 3):
|
if (3, 0) <= sys.version_info < (3, 3):
|
||||||
raise SystemExit("Python 3.0, 3.1 and 3.2 are not supported")
|
raise SystemExit("Python 3.0, 3.1 and 3.2 are not supported")
|
||||||
|
|
||||||
if sys.version_info < (3, 0):
|
if sys.version_info < (3, 0):
|
||||||
requires += ['ipaddress', 'configparser']
|
requires += ['ipaddress', 'configparser', 'werkzeug>=0.8']
|
||||||
|
else:
|
||||||
|
requires += ['werkzeug>=0.9']
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='isso',
|
name='isso',
|
||||||
|
Loading…
Reference in New Issue
Block a user