diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-05 13:01:41 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-05 13:01:41 +0200 |
commit | 00b2c86d09dccf125fdf7108d3b749f767c277db (patch) | |
tree | eabc9535fde700e8e75f3a3be055054904901bcd /Lib/test/test_codecs.py | |
parent | 4637309ee66381d081e3e86f72665ca08fc6e634 (diff) | |
download | cpython-git-00b2c86d09dccf125fdf7108d3b749f767c277db.tar.gz |
Fix text failures when ctypes is not available
(followup to Victor's 85d11cf67aa8 and 7a50e549bd11)
Diffstat (limited to 'Lib/test/test_codecs.py')
-rw-r--r-- | Lib/test/test_codecs.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index f70ae3364a..e9ce95a866 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -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): """ |