SiftScience / sift-python

Sift API (Python client)
MIT License
20 stars 23 forks source link

Fix Python 2.6 compatibility #23

Closed arthurk closed 9 years ago

arthurk commented 9 years ago

The code is not compatible with Python 2.6 and fails with:

>       if sys.version_info.major < 3:
E       AttributeError: 'tuple' object has no attribute 'major'

The reason is that Python 2.6 version_info has no major attribute. This fixes the problem. According to https://docs.python.org/2/library/sys.html#sys.version_info sys.version_info[0] is equivalent to sys.version_info.major

ghost commented 9 years ago

@yschatzberg mind taking a look at this? Thanks

yschatzberg commented 9 years ago

@arthurk There are some minor changes that need to be added to this PR before it gets merged into our master. Embarrassingly enough I can't figure out how to do it without creating a clone on my repo and fixing there. Thoughts on how I can commit changes to this PR?

arthurk commented 9 years ago

@yschatzberg you'll have to clone my fork at https://github.com/arthurk/sift-python/ and commit changes to the python_26_compat branch. They will then show up in this PR.

yschatzberg commented 9 years ago

Ah perfect. I attempted to push my changes back to python_26_compat but it says I do not have authentication? Do you need to give me permission to push to your fork @arthurk?

arthurk commented 9 years ago

@yschatzberg done, could you try again?