diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2017-07-13 16:48:32 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2017-07-13 16:48:32 +0200 |
commit | 5e221d78795416df7612b79a9d46bc5aedbde836 (patch) | |
tree | 69ab910f65d3a44d9c2c37d941fdc6eaef44df2e | |
parent | a081949051216cadfc8e053e02f378ee8da9ee94 (diff) | |
download | cython-5e221d78795416df7612b79a9d46bc5aedbde836.tar.gz |
make fastcall test work in Py2.6+
-rwxr-xr-x | runtests.py | 1 | ||||
-rw-r--r-- | tests/run/fastcall.pyx | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/runtests.py b/runtests.py index 018e3a001..88f5053da 100755 --- a/runtests.py +++ b/runtests.py @@ -349,7 +349,6 @@ VER_DEP_MODULES = { (3,4): (operator.lt, lambda x: x in ['run.py34_signature', ]), (3,5): (operator.lt, lambda x: x in ['run.py35_pep492_interop', - 'run.fastcall', # uses new deque features ]), } diff --git a/tests/run/fastcall.pyx b/tests/run/fastcall.pyx index 4c7f4c1e8..4ba34d728 100644 --- a/tests/run/fastcall.pyx +++ b/tests/run/fastcall.pyx @@ -1,6 +1,7 @@ # mode: run # tag: METH_FASTCALL +import sys import struct from collections import deque @@ -12,7 +13,12 @@ def deque_methods(v): """ d = deque([1, 3, 4]) assert list(d) == [1,3,4] - d.insert(1, v) + if sys.version_info >= (3, 5): + d.insert(1, v) + else: + d.rotate(-1) + d.appendleft(2) + d.rotate(1) assert list(d) == [1,2,3,4] d.rotate(len(d) // 2) assert list(d) == [3,4,1,2] |