diff options
author | elie <elie> | 2014-06-15 07:54:52 +0000 |
---|---|---|
committer | elie <elie> | 2014-06-15 07:54:52 +0000 |
commit | 87cb54cf65768c1874cdceeb539ec07a336519da (patch) | |
tree | de36f598420abe6d9b6158276a7756589932dc98 | |
parent | 599c9614614b48a45b6d51d9f7288c44b791b5c2 (diff) | |
download | pyasn1-87cb54cf65768c1874cdceeb539ec07a336519da.tar.gz |
__trunc__ is only available since python 2.6
-rw-r--r-- | pyasn1/type/univ.py | 4 | ||||
-rw-r--r-- | test/type/test_univ.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py index 8638ad2..7101da4 100644 --- a/pyasn1/type/univ.py +++ b/pyasn1/type/univ.py @@ -76,7 +76,7 @@ class Integer(base.AbstractSimpleAsn1Item): return r def __floor__(self): return math.floor(self._value) def __ceil__(self): return math.ceil(self._value) - if sys.version_info[0:2] > (2, 4): + if sys.version_info[0:2] > (2, 5): def __trunc__(self): return self.clone(math.trunc(self._value)) def __lt__(self, value): return self._value < value @@ -667,7 +667,7 @@ class Real(base.AbstractSimpleAsn1Item): return r def __floor__(self): return self.clone(math.floor(float(self))) def __ceil__(self): return self.clone(math.ceil(float(self))) - if sys.version_info[0:2] > (2, 4): + if sys.version_info[0:2] > (2, 5): def __trunc__(self): return self.clone(math.trunc(float(self))) def __lt__(self, value): return float(self) < value diff --git a/test/type/test_univ.py b/test/type/test_univ.py index 9a14963..b973164 100644 --- a/test/type/test_univ.py +++ b/test/type/test_univ.py @@ -48,7 +48,7 @@ class IntegerTestCase(unittest.TestCase): assert math.floor(univ.Integer(1)) == 1,'__floor__() fails' def testCeil(self): assert math.ceil(univ.Integer(1)) == 1,'__ceil__() fails' - if version_info[0:2] > (2, 4): + if version_info[0:2] > (2, 5): def testTrunc(self): assert math.trunc(univ.Integer(1)) == 1,'__trunc__() fails' def testPrettyIn(self): assert univ.Integer('3') == 3, 'prettyIn() fails' @@ -250,7 +250,7 @@ class RealTestCase(unittest.TestCase): assert math.floor(univ.Real(1.6)) == 1.0,'__floor__() fails' def testCeil(self): assert math.ceil(univ.Real(1.2)) == 2.0,'__ceil__() fails' - if version_info[0:2] > (2, 4): + if version_info[0:2] > (2, 5): def testTrunc(self): assert math.trunc(univ.Real(1.1)) == 1.0,'__trunc__() fails' |