Skip to content

Commit b8a495f

Browse files
committed
Fixing enum34 error
1 parent abab5aa commit b8a495f

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# SQLAlchemy-JSONAPI Changelog
22

3+
## 2.0.2
4+
5+
*In Progress*
6+
7+
* Fixes Python 2.7 compatibility
8+
39
## 2.0.1
410

511
*2015-09-16*

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@
1111
"""
1212

1313
from setuptools import setup
14+
import sys
15+
16+
requirements = ['SQLAlchemy', 'inflection']
17+
18+
if sys.version_info[0] != 3 or sys.version_info[1] < 4:
19+
requirements.append('enum34')
1420

1521
setup(name='SQLAlchemy-JSONAPI',
16-
version='2.0.1',
22+
version='2.0.2',
1723
url='http://github.com/coltonprovias/sqlalchemy-jsonapi',
1824
license='MIT',
1925
author='Colton J. Provias',
@@ -24,7 +30,7 @@
2430
zip_safe=False,
2531
include_package_data=True,
2632
platforms='any',
27-
install_requires=['SQLAlchemy', 'inflection'],
33+
install_requires=requirements,
2834
classifiers=[
2935
'Development Status :: 5 - Production/Stable',
3036
'Environment :: Web Environment',

sqlalchemy_jsonapi/flaskext.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
import uuid
1111

1212
from blinker import signal
13-
from enum import Enum
1413
from flask import make_response, request
1514

1615
from .errors import BaseError, MissingContentTypeError
1716
from .serializer import JSONAPI
1817

18+
try:
19+
from enum import Enum
20+
except ImportError:
21+
from enum34 import Enum
22+
1923

2024
class Method(Enum):
2125
""" HTTP Methods used by JSON API """

0 commit comments

Comments
 (0)