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
842d921a
Kaydet (Commit)
842d921a
authored
Eyl 02, 2011
tarafından
Amaury Forgeot d'Arc
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ctypes: Slightly better error message when a struct field name is not a string.
üst
154f2b47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
stgdict.c
Modules/_ctypes/stgdict.c
+5
-7
No files found.
Modules/_ctypes/stgdict.c
Dosyayı görüntüle @
842d921a
...
...
@@ -426,9 +426,9 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
StgDictObject
*
dict
;
int
bitsize
=
0
;
if
(
!
pair
||
!
PyArg_ParseTuple
(
pair
,
"
O
O|i"
,
&
name
,
&
desc
,
&
bitsize
))
{
PyErr_SetString
(
PyExc_
Attribut
eError
,
"'_fields_' must be a sequence of pairs"
);
if
(
!
pair
||
!
PyArg_ParseTuple
(
pair
,
"
U
O|i"
,
&
name
,
&
desc
,
&
bitsize
))
{
PyErr_SetString
(
PyExc_
Typ
eError
,
"'_fields_' must be a sequence of
(name, C type)
pairs"
);
Py_XDECREF
(
pair
);
return
-
1
;
}
...
...
@@ -478,6 +478,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
}
}
else
bitsize
=
0
;
if
(
isStruct
&&
!
isPacked
)
{
char
*
fieldfmt
=
dict
->
format
?
dict
->
format
:
"B"
;
char
*
fieldname
=
_PyUnicode_AsString
(
name
);
...
...
@@ -487,10 +488,6 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
if
(
fieldname
==
NULL
)
{
PyErr_Format
(
PyExc_TypeError
,
"structure field name must be string not %s"
,
name
->
ob_type
->
tp_name
);
Py_DECREF
(
pair
);
return
-
1
;
}
...
...
@@ -509,6 +506,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
return
-
1
;
}
}
if
(
isStruct
)
{
prop
=
PyCField_FromDesc
(
desc
,
i
,
&
field_size
,
bitsize
,
&
bitofs
,
...
...
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