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
894258ce
Kaydet (Commit)
894258ce
authored
Eyl 23, 2001
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reactivate participation of expat parsers in GC. Fixes bug #462710.
üst
8ca177bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
pyexpat.c
Modules/pyexpat.c
+33
-2
No files found.
Modules/pyexpat.c
Dosyayı görüntüle @
894258ce
...
@@ -977,8 +977,13 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
...
@@ -977,8 +977,13 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
#if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6
#if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6
new_parser
=
PyObject_NEW
(
xmlparseobject
,
&
Xmlparsetype
);
new_parser
=
PyObject_NEW
(
xmlparseobject
,
&
Xmlparsetype
);
#else
#else
/* Python versions 1.6 and later */
#ifndef Py_TPFLAGS_HAVE_GC
/* Python versions 1.6 to 2.1 */
new_parser
=
PyObject_New
(
xmlparseobject
,
&
Xmlparsetype
);
new_parser
=
PyObject_New
(
xmlparseobject
,
&
Xmlparsetype
);
#else
/* Python versions 2.2 and later */
new_parser
=
PyObject_GC_New
(
xmlparseobject
,
&
Xmlparsetype
);
#endif
#endif
#endif
if
(
new_parser
==
NULL
)
if
(
new_parser
==
NULL
)
...
@@ -990,7 +995,11 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
...
@@ -990,7 +995,11 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
new_parser
->
itself
=
XML_ExternalEntityParserCreate
(
self
->
itself
,
context
,
new_parser
->
itself
=
XML_ExternalEntityParserCreate
(
self
->
itself
,
context
,
encoding
);
encoding
);
new_parser
->
handlers
=
0
;
new_parser
->
handlers
=
0
;
#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_Track
(
new_parser
);
#else
PyObject_GC_Init
(
new_parser
);
PyObject_GC_Init
(
new_parser
);
#endif
if
(
!
new_parser
->
itself
)
{
if
(
!
new_parser
->
itself
)
{
Py_DECREF
(
new_parser
);
Py_DECREF
(
new_parser
);
...
@@ -1139,7 +1148,12 @@ newxmlparseobject(char *encoding, char *namespace_separator)
...
@@ -1139,7 +1148,12 @@ newxmlparseobject(char *encoding, char *namespace_separator)
self
->
returns_unicode
=
0
;
self
->
returns_unicode
=
0
;
#else
#else
/* Code for versions 1.6 and later */
/* 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
);
#else
self
=
PyObject_New
(
xmlparseobject
,
&
Xmlparsetype
);
self
=
PyObject_New
(
xmlparseobject
,
&
Xmlparsetype
);
#endif
if
(
self
==
NULL
)
if
(
self
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -1155,7 +1169,11 @@ newxmlparseobject(char *encoding, char *namespace_separator)
...
@@ -1155,7 +1169,11 @@ newxmlparseobject(char *encoding, char *namespace_separator)
else
{
else
{
self
->
itself
=
XML_ParserCreate
(
encoding
);
self
->
itself
=
XML_ParserCreate
(
encoding
);
}
}
#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_Track
(
self
);
#else
PyObject_GC_Init
(
self
);
PyObject_GC_Init
(
self
);
#endif
if
(
self
->
itself
==
NULL
)
{
if
(
self
->
itself
==
NULL
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
PyErr_SetString
(
PyExc_RuntimeError
,
"XML_ParserCreate failed"
);
"XML_ParserCreate failed"
);
...
@@ -1185,7 +1203,11 @@ static void
...
@@ -1185,7 +1203,11 @@ static void
xmlparse_dealloc
(
xmlparseobject
*
self
)
xmlparse_dealloc
(
xmlparseobject
*
self
)
{
{
int
i
;
int
i
;
#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_UnTrack
(
self
);
#else
PyObject_GC_Fini
(
self
);
PyObject_GC_Fini
(
self
);
#endif
if
(
self
->
itself
!=
NULL
)
if
(
self
->
itself
!=
NULL
)
XML_ParserFree
(
self
->
itself
);
XML_ParserFree
(
self
->
itself
);
self
->
itself
=
NULL
;
self
->
itself
=
NULL
;
...
@@ -1203,8 +1225,13 @@ xmlparse_dealloc(xmlparseobject *self)
...
@@ -1203,8 +1225,13 @@ xmlparse_dealloc(xmlparseobject *self)
/* Code for versions before 1.6 */
/* Code for versions before 1.6 */
free
(
self
);
free
(
self
);
#else
#else
/* Code for versions 1.6 and later */
#ifndef Py_TPFLAGS_HAVE_GC
/* Code for versions 1.6 to 2.1 */
PyObject_Del
(
self
);
PyObject_Del
(
self
);
#else
/* Code for versions 2.2 and later. */
PyObject_GC_Del
(
self
);
#endif
#endif
#endif
}
}
...
@@ -1370,7 +1397,11 @@ static PyTypeObject Xmlparsetype = {
...
@@ -1370,7 +1397,11 @@ static PyTypeObject Xmlparsetype = {
0
,
/* tp_getattro */
0
,
/* tp_getattro */
0
,
/* tp_setattro */
0
,
/* tp_setattro */
0
,
/* tp_as_buffer */
0
,
/* tp_as_buffer */
#ifdef Py_TPFLAGS_HAVE_GC
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_HAVE_GC
,
/*tp_flags*/
#else
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_GC
,
/*tp_flags*/
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_GC
,
/*tp_flags*/
#endif
Xmlparsetype__doc__
,
/* Documentation string */
Xmlparsetype__doc__
,
/* Documentation string */
#ifdef WITH_CYCLE_GC
#ifdef WITH_CYCLE_GC
(
traverseproc
)
xmlparse_traverse
,
/* tp_traverse */
(
traverseproc
)
xmlparse_traverse
,
/* tp_traverse */
...
...
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