Disable tests broken in python 2.4 and 2.5

These tests were added in 2f8a7b82 and fc8e7654 in #572 and #573
but a change from a few months ago meant that the requested version of
Python was not actually being used during testing when these were added.
This commit is contained in:
William S Fulton 2016-02-04 07:37:22 +00:00
commit 26d0b7f5b9

View file

@ -1,4 +1,3 @@
import ctypes
import sys
from primitive_types import *
@ -443,6 +442,11 @@ if v != 4:
# Check the bounds for converting various types
#
# ctypes not available until 2.5
if sys.version_info[0:2] <= (2, 4):
sys.exit(0)
import ctypes
# Get the minimum and maximum values that fit in signed char, short, int, long, and long long
overchar = 2 ** 7
while ctypes.c_byte(overchar).value > 0:
@ -602,5 +606,6 @@ def checkType(name, maxfunc, maxval, minfunc, minval, echofunc):
raise RuntimeError, "bad " + name + " typemap"
# sys.maxsize is the largest value supported by Py_ssize_t, which should be the same as ptrdiff_t
checkType("ptrdiff_t", get_ptrdiff_max, sys.maxsize, get_ptrdiff_min, -(sys.maxsize + 1), ptrdiff_echo)
checkType("size_t", get_size_max, (2 * sys.maxsize) + 1, get_size_min, 0, size_echo)
if sys.version_info[0:2] >= (2, 6):
checkType("ptrdiff_t", get_ptrdiff_max, sys.maxsize, get_ptrdiff_min, -(sys.maxsize + 1), ptrdiff_echo)
checkType("size_t", get_size_max, (2 * sys.maxsize) + 1, get_size_min, 0, size_echo)