Commit 5e221d78 authored by Stefan Behnel's avatar Stefan Behnel

make fastcall test work in Py2.6+

parent a0819490
...@@ -349,7 +349,6 @@ VER_DEP_MODULES = { ...@@ -349,7 +349,6 @@ VER_DEP_MODULES = {
(3,4): (operator.lt, lambda x: x in ['run.py34_signature', (3,4): (operator.lt, lambda x: x in ['run.py34_signature',
]), ]),
(3,5): (operator.lt, lambda x: x in ['run.py35_pep492_interop', (3,5): (operator.lt, lambda x: x in ['run.py35_pep492_interop',
'run.fastcall', # uses new deque features
]), ]),
} }
......
# mode: run # mode: run
# tag: METH_FASTCALL # tag: METH_FASTCALL
import sys
import struct import struct
from collections import deque from collections import deque
...@@ -12,7 +13,12 @@ def deque_methods(v): ...@@ -12,7 +13,12 @@ def deque_methods(v):
""" """
d = deque([1, 3, 4]) d = deque([1, 3, 4])
assert list(d) == [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] assert list(d) == [1,2,3,4]
d.rotate(len(d) // 2) d.rotate(len(d) // 2)
assert list(d) == [3,4,1,2] assert list(d) == [3,4,1,2]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment