Skip to content

Commit 83df40d

Browse files
committed
Fixed compat issues with py2.6 and 3.3
1 parent 37375fe commit 83df40d

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎tests/test_validation_failure.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import validators
2+
import six
23

34

45
obj_repr = (
@@ -19,10 +20,7 @@ def test_repr(self):
1920
assert repr(self.obj) == obj_repr
2021

2122
def test_unicode(self):
22-
assert unicode(self.obj) == obj_repr
23-
24-
def test_str(self):
25-
assert str(self.obj) == obj_repr
23+
assert six.text_type(self.obj) == obj_repr
2624

2725
def test_arguments_as_properties(self):
2826
assert self.obj.value == 3

‎validators/extremes.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
from functools import total_ordering
1+
try:
2+
from functools import total_ordering
3+
except ImportError:
4+
# Use Python 2.6 port
5+
from total_ordering import total_ordering
26

37

48
@total_ordering

0 commit comments

Comments
 (0)