Fix text failures when ctypes is not available

(followup to Victor's 85d11cf67aa8 and 7a50e549bd11)
This commit is contained in:
Antoine Pitrou 2011-10-05 13:01:41 +02:00
parent 4637309ee6
commit 00b2c86d09
2 changed files with 39 additions and 28 deletions

View file

@ -3,9 +3,14 @@ import unittest
import codecs
import locale
import sys, _testcapi, io
import ctypes
SIZEOF_WCHAR_T = ctypes.sizeof(ctypes.c_wchar)
try:
import ctypes
except ImportError:
ctypes = None
SIZEOF_WCHAR_T = -1
else:
SIZEOF_WCHAR_T = ctypes.sizeof(ctypes.c_wchar)
class Queue(object):
"""