mirror of
https://github.com/python/cpython.git
synced 2024-11-28 12:31:14 +08:00
Fix tests when ctypes isn't available
This commit is contained in:
parent
2baf1a69f4
commit
0662bc297a
@ -1439,6 +1439,7 @@ class UnicodeTest(string_tests.CommonTest,
|
||||
# Test PyUnicode_AsWideChar()
|
||||
def test_aswidechar(self):
|
||||
from _testcapi import unicode_aswidechar
|
||||
support.import_module('ctypes')
|
||||
from ctypes import c_wchar, sizeof
|
||||
|
||||
wchar, size = unicode_aswidechar('abcdef', 2)
|
||||
@ -1475,6 +1476,7 @@ class UnicodeTest(string_tests.CommonTest,
|
||||
# Test PyUnicode_AsWideCharString()
|
||||
def test_aswidecharstring(self):
|
||||
from _testcapi import unicode_aswidecharstring
|
||||
support.import_module('ctypes')
|
||||
from ctypes import c_wchar, sizeof
|
||||
|
||||
wchar, size = unicode_aswidecharstring('abc')
|
||||
|
Loading…
Reference in New Issue
Block a user