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
39013cd4
Kaydet (Commit)
39013cd4
authored
Eki 24, 2007
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
A 'PyObject *' parameter in PyErr_Format must use %S parameter, not %s.
Added unittest for calling a function with paramflags.
üst
bd1c68c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
test_prototypes.py
Lib/ctypes/test/test_prototypes.py
+18
-0
_ctypes.c
Modules/_ctypes/_ctypes.c
+1
-1
No files found.
Lib/ctypes/test/test_prototypes.py
Dosyayı görüntüle @
39013cd4
...
...
@@ -48,6 +48,24 @@ class CharPointersTestCase(unittest.TestCase):
func
.
restype
=
c_long
func
.
argtypes
=
None
def
test_paramflags
(
self
):
# function returns c_void_p result,
# and has a required parameter named 'input'
prototype
=
CFUNCTYPE
(
c_void_p
,
c_void_p
)
func
=
prototype
((
"_testfunc_p_p"
,
testdll
),
((
1
,
"input"
),))
try
:
func
()
except
TypeError
as
details
:
self
.
failUnlessEqual
(
str
(
details
),
"required argument 'input' missing"
)
else
:
self
.
fail
(
"TypeError not raised"
)
self
.
failUnlessEqual
(
func
(
None
),
None
)
self
.
failUnlessEqual
(
func
(
input
=
None
),
None
)
def
test_int_pointer_arg
(
self
):
func
=
testdll
.
_testfunc_p_p
func
.
restype
=
c_long
...
...
Modules/_ctypes/_ctypes.c
Dosyayı görüntüle @
39013cd4
...
...
@@ -2992,7 +2992,7 @@ _get_arg(int *pindex, PyObject *name, PyObject *defval, PyObject *inargs, PyObje
/* we can't currently emit a better error message */
if
(
name
)
PyErr_Format
(
PyExc_TypeError
,
"required argument '%
s
' missing"
,
name
);
"required argument '%
S
' missing"
,
name
);
else
PyErr_Format
(
PyExc_TypeError
,
"not enough arguments"
);
...
...
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