Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
9d512ab9
Kaydet (Commit)
9d512ab9
authored
Agu 08, 2012
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #13072: Fix test_array for installation without the ctypes module
üst
22701e86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
test_array.py
Lib/test/test_array.py
+11
-2
No files found.
Lib/test/test_array.py
Dosyayı görüntüle @
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