Permalink
Browse files

remove Python 2.5 compatability

  • Loading branch information...
stefankoegl committed Dec 14, 2012
1 parent 7c7a1f5 commit 0e6772b3a300549e8a1030c13c59f0ee7b62dcaa
Showing with 5 additions and 20 deletions.
  1. +0 −1 .travis.yml
  2. +5 −18 jsonpatch.py
  3. +0 −1 requirements.txt
View
@@ -1,6 +1,5 @@
language: python
python:
- - "2.5"
- "2.6"
- "2.7"
- "3.2"
View
@@ -43,10 +43,7 @@
import copy
import sys
-if sys.version_info < (2, 6):
- import simplejson as json
-else:
- import json
+import json
import jsonpointer
@@ -352,13 +349,8 @@ def apply(self, obj):
subobj, part = self.pointer.to_last(obj)
try:
del subobj[part]
- except KeyError:
- exc_info = sys.exc_info()
- exc = JsonPatchConflict(str(exc_info[1]))
- if sys.version_info >= (3, 0):
- raise exc.with_traceback(exc_info[2])
- else:
- raise exc
+ except KeyError as ex:
+ raise JsonPatchConflict(str(ex))
class AddOperation(PatchOperation):
@@ -439,13 +431,8 @@ def apply(self, obj):
else:
val = self.pointer.walk(subobj, part)
- except JsonPointerException:
- exc_info = sys.exc_info()
- exc = JsonPatchTestFailed(str(exc_info[1]))
- if sys.version_info >= (3, 0):
- raise exc.with_traceback(exc_info[2])
- else:
- raise exc
+ except JsonPointerException as ex:
+ raise JsonPatchTestFailed(str(ex))
if 'value' in self.operation:
value = self.operation['value']
View
@@ -1,2 +1 @@
-simplejson #required for Python 2.5 compatability
jsonpointer>=0.5

2 comments on commit 0e6772b

@kxepal

This comment has been minimized.

Show comment Hide comment
@kxepal

kxepal Dec 17, 2012

Contributor

Hooray!(: However, removing support of 6-years old Python release, this commit also breaks module for Jython which only has 2.5 version as stable while 2.7 is early alpha. Is it ok?

Contributor

kxepal replied Dec 17, 2012

Hooray!(: However, removing support of 6-years old Python release, this commit also breaks module for Jython which only has 2.5 version as stable while 2.7 is early alpha. Is it ok?

@stefankoegl

This comment has been minimized.

Show comment Hide comment
@stefankoegl

stefankoegl Dec 17, 2012

Owner

Yes, I knew this would break Jython support. But I think Jython users will have the same problems with other libraries as well until it catches up.

Owner

stefankoegl replied Dec 17, 2012

Yes, I knew this would break Jython support. But I think Jython users will have the same problems with other libraries as well until it catches up.

Please sign in to comment.