Fix text failures when ctypes is not available
(followup to Victor's 85d11cf67aa8 and 7a50e549bd11)
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index f70ae33..e9ce95a 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -3,9 +3,14 @@
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):
"""