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
b4fcf4d1
Kaydet (Commit)
b4fcf4d1
authored
Haz 30, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Define PyDoc_STRVAR if it is not available (PyXML 1.54).
Remove support for Python 1.5 (PyXML 1.55).
üst
6b2cf0e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
63 deletions
+11
-63
pyexpat.c
Modules/pyexpat.c
+11
-63
No files found.
Modules/pyexpat.c
Dosyayı görüntüle @
b4fcf4d1
#include "Python.h"
#if PY_VERSION_HEX < 0x020000B1
#include <assert.h>
#endif
#include <ctype.h>
#include "compile.h"
#include "frameobject.h"
#include "expat.h"
#ifndef PyGC_HEAD_SIZE
#define PyGC_HEAD_SIZE 0
#define PyObject_GC_Init(x)
#define PyObject_GC_Fini(m)
#define Py_TPFLAGS_GC 0
#ifndef PyDoc_STRVAR
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
#endif
#if (PY_MAJOR_VERSION ==
1 && PY_MINOR_VERSION > 5) || (PY_MAJOR_VERSION ==
2 && PY_MINOR_VERSION < 2)
/* In Python
1.6,
2.0 and 2.1, disabling Unicode was not possible. */
#if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 2)
/* In Python 2.0 and 2.1, disabling Unicode was not possible. */
#define Py_USING_UNICODE
#endif
...
...
@@ -297,7 +291,7 @@ call_with_frame(PyCodeObject *c, PyObject* func, PyObject* args)
#ifndef Py_USING_UNICODE
#define STRING_CONV_FUNC conv_string_to_utf8
#else
/* Python
1.6
and later versions */
/* Python
2.0
and later versions */
#define STRING_CONV_FUNC (self->returns_unicode \
? conv_string_to_unicode : conv_string_to_utf8)
#endif
...
...
@@ -958,16 +952,12 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
return
NULL
;
}
#if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6
new_parser
=
PyObject_NEW
(
xmlparseobject
,
&
Xmlparsetype
);
#else
#ifndef Py_TPFLAGS_HAVE_GC
/* Python versions
1.6 to
2.1 */
/* Python versions
2.0 and
2.1 */
new_parser
=
PyObject_New
(
xmlparseobject
,
&
Xmlparsetype
);
#else
/* Python versions 2.2 and later */
new_parser
=
PyObject_GC_New
(
xmlparseobject
,
&
Xmlparsetype
);
#endif
#endif
if
(
new_parser
==
NULL
)
...
...
@@ -1127,14 +1117,6 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
int
i
;
xmlparseobject
*
self
;
#if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6
self
=
PyObject_NEW
(
xmlparseobject
,
&
Xmlparsetype
);
if
(
self
==
NULL
)
return
NULL
;
self
->
returns_unicode
=
0
;
#else
/* Code for versions 1.6 and later */
#ifdef Py_TPFLAGS_HAVE_GC
/* Code for versions 2.2 and later */
self
=
PyObject_GC_New
(
xmlparseobject
,
&
Xmlparsetype
);
...
...
@@ -1144,8 +1126,12 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
if
(
self
==
NULL
)
return
NULL
;
#ifdef Py_USING_UNICODE
self
->
returns_unicode
=
1
;
#else
self
->
returns_unicode
=
0
;
#endif
self
->
buffer
=
NULL
;
self
->
buffer_size
=
CHARACTER_DATA_BUFFER_SIZE
;
self
->
buffer_used
=
0
;
...
...
@@ -1219,18 +1205,13 @@ xmlparse_dealloc(xmlparseobject *self)
self
->
buffer
=
NULL
;
}
Py_XDECREF
(
self
->
intern
);
#if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6
/* Code for versions before 1.6 */
free
(
self
);
#else
#ifndef Py_TPFLAGS_HAVE_GC
/* Code for versions
1.6 to
2.1 */
/* Code for versions
2.0 and
2.1 */
PyObject_Del
(
self
);
#else
/* Code for versions 2.2 and later. */
PyObject_GC_Del
(
self
);
#endif
#endif
}
static
int
...
...
@@ -1563,39 +1544,6 @@ static struct PyMethodDef pyexpat_methods[] = {
PyDoc_STRVAR
(
pyexpat_module_documentation
,
"Python wrapper for Expat parser."
);
#if PY_VERSION_HEX < 0x20000F0
/* 1.5 compatibility: PyModule_AddObject */
static
int
PyModule_AddObject
(
PyObject
*
m
,
char
*
name
,
PyObject
*
o
)
{
PyObject
*
dict
;
if
(
!
PyModule_Check
(
m
)
||
o
==
NULL
)
return
-
1
;
dict
=
PyModule_GetDict
(
m
);
if
(
dict
==
NULL
)
return
-
1
;
if
(
PyDict_SetItemString
(
dict
,
name
,
o
))
return
-
1
;
Py_DECREF
(
o
);
return
0
;
}
static
int
PyModule_AddIntConstant
(
PyObject
*
m
,
char
*
name
,
long
value
)
{
return
PyModule_AddObject
(
m
,
name
,
PyInt_FromLong
(
value
));
}
static
int
PyModule_AddStringConstant
(
PyObject
*
m
,
char
*
name
,
char
*
value
)
{
return
PyModule_AddObject
(
m
,
name
,
PyString_FromString
(
value
));
}
#endif
/* Return a Python string that represents the version number without the
* extra cruft added by revision control, even if the right options were
* given to the "cvs export" command to make it not include the extra
...
...
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