Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9d512ab9
Commit
9d512ab9
authored
Aug 09, 2012
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #13072: Fix test_array for installation without the ctypes module
parent
22701e86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
Lib/test/test_array.py
Lib/test/test_array.py
+11
-2
No files found.
Lib/test/test_array.py
View file @
9d512ab9
...
...
@@ -3,7 +3,6 @@
Roger E. Masse
"""
import
ctypes
import
unittest
from
test
import
support
import
weakref
...
...
@@ -1033,6 +1032,16 @@ class UnicodeTest(StringTest):
minitemsize
=
2
def
test_unicode
(
self
):
try
:
import
ctypes
sizeof_wchar
=
ctypes
.
sizeof
(
ctypes
.
c_wchar
)
except
ImportError
:
import
sys
if
sys
.
platform
==
'win32'
:
sizeof_wchar
=
2
else
:
sizeof_wchar
=
4
self
.
assertRaises
(
TypeError
,
array
.
array
,
'b'
,
'foo'
)
a
=
array
.
array
(
'u'
,
'
\
xa0
\
xc2
\
u1234
'
)
...
...
@@ -1042,7 +1051,7 @@ class UnicodeTest(StringTest):
a
.
fromunicode
(
'
\
x11
abc
\
xff
\
u1234
'
)
s
=
a
.
tounicode
()
self
.
assertEqual
(
s
,
'
\
xa0
\
xc2
\
u1234
\
x11
abc
\
xff
\
u1234
'
)
self
.
assertEqual
(
a
.
itemsize
,
ctypes
.
sizeof
(
ctypes
.
c_wchar
)
)
self
.
assertEqual
(
a
.
itemsize
,
sizeof_wchar
)
s
=
'
\
x00
="
\
'
a
\
\
b
\
x80
\
xff
\
u0000
\
u0001
\
u1234
'
a
=
array
.
array
(
'u'
,
s
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment