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
6be522bf
Kaydet (Commit)
6be522bf
authored
Eyl 18, 2009
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...)
does now always result in NULL.
üst
7a352c0e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
test_parameters.py
Lib/ctypes/test/test_parameters.py
+1
-1
NEWS
Misc/NEWS
+5
-2
_ctypes.c
Modules/_ctypes/_ctypes.c
+5
-2
callproc.c
Modules/_ctypes/callproc.c
+1
-0
No files found.
Lib/ctypes/test/test_parameters.py
Dosyayı görüntüle @
6be522bf
...
@@ -97,7 +97,7 @@ class SimpleTypesTestCase(unittest.TestCase):
...
@@ -97,7 +97,7 @@ class SimpleTypesTestCase(unittest.TestCase):
self
.
assertEqual
(
x
.
contents
.
value
,
42
)
self
.
assertEqual
(
x
.
contents
.
value
,
42
)
self
.
assertEqual
(
LPINT
(
c_int
(
42
))
.
contents
.
value
,
42
)
self
.
assertEqual
(
LPINT
(
c_int
(
42
))
.
contents
.
value
,
42
)
self
.
assertEqual
(
LPINT
.
from_param
(
None
),
0
)
self
.
assertEqual
(
LPINT
.
from_param
(
None
),
None
)
if
c_int
!=
c_long
:
if
c_int
!=
c_long
:
self
.
assertRaises
(
TypeError
,
LPINT
.
from_param
,
pointer
(
c_long
(
42
)))
self
.
assertRaises
(
TypeError
,
LPINT
.
from_param
,
pointer
(
c_long
(
42
)))
...
...
Misc/NEWS
Dosyayı görüntüle @
6be522bf
...
@@ -376,8 +376,11 @@ Core and Builtins
...
@@ -376,8 +376,11 @@ Core and Builtins
Library
Library
-------
-------
- Issue #5042: Structure sub-subclass does now initialize correctly
- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...)
with base class positional arguments.
does now always result in NULL.
- Issue #5042: ctypes Structure sub-subclass does now initialize
correctly with base class positional arguments.
- Issue #6938: Fix a TypeError in string formatting of a multiprocessing
- Issue #6938: Fix a TypeError in string formatting of a multiprocessing
debug message.
debug message.
...
...
Modules/_ctypes/_ctypes.c
Dosyayı görüntüle @
6be522bf
...
@@ -972,8 +972,11 @@ PyCPointerType_from_param(PyObject *type, PyObject *value)
...
@@ -972,8 +972,11 @@ PyCPointerType_from_param(PyObject *type, PyObject *value)
{
{
StgDictObject
*
typedict
;
StgDictObject
*
typedict
;
if
(
value
==
Py_None
)
if
(
value
==
Py_None
)
{
return
PyInt_FromLong
(
0
);
/* NULL pointer */
/* ConvParam will convert to a NULL pointer later */
Py_INCREF
(
value
);
return
value
;
}
typedict
=
PyType_stgdict
(
type
);
typedict
=
PyType_stgdict
(
type
);
assert
(
typedict
);
/* Cannot be NULL for pointer types */
assert
(
typedict
);
/* Cannot be NULL for pointer types */
...
...
Modules/_ctypes/callproc.c
Dosyayı görüntüle @
6be522bf
...
@@ -542,6 +542,7 @@ PyTypeObject PyCArg_Type = {
...
@@ -542,6 +542,7 @@ PyTypeObject PyCArg_Type = {
* C function call.
* C function call.
*
*
* 1. Python integers are converted to C int and passed by value.
* 1. Python integers are converted to C int and passed by value.
* Py_None is converted to a C NULL pointer.
*
*
* 2. 3-tuples are expected to have a format character in the first
* 2. 3-tuples are expected to have a format character in the first
* item, which must be 'i', 'f', 'd', 'q', or 'P'.
* item, which must be 'i', 'f', 'd', 'q', or 'P'.
...
...
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