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
8e8ba151
Kaydet (Commit)
8e8ba151
authored
Nis 04, 2008
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #2543: Make ctypes compatible (again) with Python 2.3, 2.4, and 2.5.
üst
46c58c17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
27 deletions
+39
-27
test_prototypes.py
Lib/ctypes/test/test_prototypes.py
+1
-1
_ctypes.c
Modules/_ctypes/_ctypes.c
+28
-26
ctypes.h
Modules/_ctypes/ctypes.h
+10
-0
No files found.
Lib/ctypes/test/test_prototypes.py
Dosyayı görüntüle @
8e8ba151
...
@@ -57,7 +57,7 @@ class CharPointersTestCase(unittest.TestCase):
...
@@ -57,7 +57,7 @@ class CharPointersTestCase(unittest.TestCase):
try
:
try
:
func
()
func
()
except
TypeError
as
details
:
except
TypeError
,
details
:
self
.
failUnlessEqual
(
str
(
details
),
"required argument 'input' missing"
)
self
.
failUnlessEqual
(
str
(
details
),
"required argument 'input' missing"
)
else
:
else
:
self
.
fail
(
"TypeError not raised"
)
self
.
fail
(
"TypeError not raised"
)
...
...
Modules/_ctypes/_ctypes.c
Dosyayı görüntüle @
8e8ba151
...
@@ -137,6 +137,34 @@ char *conversion_mode_encoding = NULL;
...
@@ -137,6 +137,34 @@ char *conversion_mode_encoding = NULL;
char
*
conversion_mode_errors
=
NULL
;
char
*
conversion_mode_errors
=
NULL
;
/****************************************************************/
#if (PY_VERSION_HEX < 0x02040000)
/* Only in Python 2.4 and up */
static
PyObject
*
PyTuple_Pack
(
int
n
,
...)
{
int
i
;
PyObject
*
o
;
PyObject
*
result
;
PyObject
**
items
;
va_list
vargs
;
va_start
(
vargs
,
n
);
result
=
PyTuple_New
(
n
);
if
(
result
==
NULL
)
return
NULL
;
items
=
((
PyTupleObject
*
)
result
)
->
ob_item
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
o
=
va_arg
(
vargs
,
PyObject
*
);
Py_INCREF
(
o
);
items
[
i
]
=
o
;
}
va_end
(
vargs
);
return
result
;
}
#endif
/****************************************************************/
/****************************************************************/
typedef
struct
{
typedef
struct
{
...
@@ -4432,32 +4460,6 @@ static PyNumberMethods Simple_as_number = {
...
@@ -4432,32 +4460,6 @@ static PyNumberMethods Simple_as_number = {
(
inquiry
)
Simple_nonzero
,
/* nb_nonzero */
(
inquiry
)
Simple_nonzero
,
/* nb_nonzero */
};
};
#if (PY_VERSION_HEX < 0x02040000)
/* Only in Python 2.4 and up */
static
PyObject
*
PyTuple_Pack
(
int
n
,
...)
{
int
i
;
PyObject
*
o
;
PyObject
*
result
;
PyObject
**
items
;
va_list
vargs
;
va_start
(
vargs
,
n
);
result
=
PyTuple_New
(
n
);
if
(
result
==
NULL
)
return
NULL
;
items
=
((
PyTupleObject
*
)
result
)
->
ob_item
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
o
=
va_arg
(
vargs
,
PyObject
*
);
Py_INCREF
(
o
);
items
[
i
]
=
o
;
}
va_end
(
vargs
);
return
result
;
}
#endif
/* "%s(%s)" % (self.__class__.__name__, self.value) */
/* "%s(%s)" % (self.__class__.__name__, self.value) */
static
PyObject
*
static
PyObject
*
Simple_repr
(
CDataObject
*
self
)
Simple_repr
(
CDataObject
*
self
)
...
...
Modules/_ctypes/ctypes.h
Dosyayı görüntüle @
8e8ba151
...
@@ -9,8 +9,18 @@
...
@@ -9,8 +9,18 @@
#if (PY_VERSION_HEX < 0x02050000)
#if (PY_VERSION_HEX < 0x02050000)
typedef
int
Py_ssize_t
;
typedef
int
Py_ssize_t
;
#define PyInt_FromSsize_t PyInt_FromLong
#define PyInt_FromSsize_t PyInt_FromLong
#define PyNumber_AsSsize_t(ob, exc) PyInt_AsLong(ob)
#endif
#endif
#if (PY_VERSION_HEX < 0x02060000)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
#define PyImport_ImportModuleNoBlock PyImport_ImportModule
#define PyIndex_Check(ob) PyInt_Check(ob)
#endif
#ifndef MS_WIN32
#ifndef MS_WIN32
#define max(a, b) ((a) > (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
...
...
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