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
dc967c13
Kaydet (Commit)
dc967c13
authored
May 31, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed the array module in unicode disabled build (regression of issue20014).
üst
062bed28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
test_array.py
Lib/test/test_array.py
+4
-1
arraymodule.c
Modules/arraymodule.c
+2
-0
No files found.
Lib/test/test_array.py
Dosyayı görüntüle @
dc967c13
...
...
@@ -18,7 +18,9 @@ class ArraySubclassWithKwargs(array.array):
array
.
array
.
__init__
(
self
,
typecode
)
tests
=
[]
# list to accumulate all tests
typecodes
=
"cubBhHiIlLfd"
typecodes
=
"cbBhHiIlLfd"
if
test_support
.
have_unicode
:
typecodes
+=
"u"
class
BadConstructorTest
(
unittest
.
TestCase
):
...
...
@@ -837,6 +839,7 @@ class CharacterTest(StringTest):
self
.
assertEqual
(
s
.
color
,
"red"
)
self
.
assertEqual
(
s
.
__dict__
.
keys
(),
[
"color"
])
@test_support.requires_unicode
def
test_nounicode
(
self
):
a
=
array
.
array
(
self
.
typecode
,
self
.
example
)
self
.
assertRaises
(
ValueError
,
a
.
fromunicode
,
unicode
(
''
))
...
...
Modules/arraymodule.c
Dosyayı görüntüle @
dc967c13
...
...
@@ -1940,8 +1940,10 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if
(
PyString_Check
(
typecode
)
&&
PyString_GET_SIZE
(
typecode
)
==
1
)
c
=
(
unsigned
char
)
*
PyString_AS_STRING
(
typecode
);
#ifdef Py_USING_UNICODE
else
if
(
PyUnicode_Check
(
typecode
)
&&
PyUnicode_GET_SIZE
(
typecode
)
==
1
)
c
=
*
PyUnicode_AS_UNICODE
(
typecode
);
#endif
else
{
PyErr_Format
(
PyExc_TypeError
,
"array() argument 1 or typecode must be char (string or "
...
...
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