Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5e1fdacc
Commit
5e1fdacc
authored
Sep 11, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove compatibility code for Python < 2.1, < 2.2 and < 2.4.
parent
9988b717
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
42 deletions
+0
-42
Modules/pyexpat.c
Modules/pyexpat.c
+0
-42
No files found.
Modules/pyexpat.c
View file @
5e1fdacc
...
@@ -258,11 +258,7 @@ trace_frame_exc(PyThreadState *tstate, PyFrameObject *f)
...
@@ -258,11 +258,7 @@ trace_frame_exc(PyThreadState *tstate, PyFrameObject *f)
value
=
Py_None
;
value
=
Py_None
;
Py_INCREF
(
value
);
Py_INCREF
(
value
);
}
}
#if PY_VERSION_HEX < 0x02040000
arg
=
Py_BuildValue
(
"(OOO)"
,
type
,
value
,
traceback
);
#else
arg
=
PyTuple_Pack
(
3
,
type
,
value
,
traceback
);
arg
=
PyTuple_Pack
(
3
,
type
,
value
,
traceback
);
#endif
if
(
arg
==
NULL
)
{
if
(
arg
==
NULL
)
{
PyErr_Restore
(
type
,
value
,
traceback
);
PyErr_Restore
(
type
,
value
,
traceback
);
return
0
;
return
0
;
...
@@ -814,11 +810,7 @@ readinst(char *buf, int buf_size, PyObject *meth)
...
@@ -814,11 +810,7 @@ readinst(char *buf, int buf_size, PyObject *meth)
PyTuple_SET_ITEM
(
arg
,
0
,
bytes
);
PyTuple_SET_ITEM
(
arg
,
0
,
bytes
);
#if PY_VERSION_HEX < 0x02020000
str
=
PyObject_CallObject
(
meth
,
arg
);
#else
str
=
PyObject_Call
(
meth
,
arg
,
NULL
);
str
=
PyObject_Call
(
meth
,
arg
,
NULL
);
#endif
if
(
str
==
NULL
)
if
(
str
==
NULL
)
goto
finally
;
goto
finally
;
...
@@ -961,14 +953,7 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
...
@@ -961,14 +953,7 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
return
NULL
;
return
NULL
;
}
}
#ifndef Py_TPFLAGS_HAVE_GC
/* 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
);
new_parser
=
PyObject_GC_New
(
xmlparseobject
,
&
Xmlparsetype
);
#endif
if
(
new_parser
==
NULL
)
if
(
new_parser
==
NULL
)
return
NULL
;
return
NULL
;
new_parser
->
buffer_size
=
self
->
buffer_size
;
new_parser
->
buffer_size
=
self
->
buffer_size
;
...
@@ -983,11 +968,7 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
...
@@ -983,11 +968,7 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
new_parser
->
handlers
=
0
;
new_parser
->
handlers
=
0
;
new_parser
->
intern
=
self
->
intern
;
new_parser
->
intern
=
self
->
intern
;
Py_XINCREF
(
new_parser
->
intern
);
Py_XINCREF
(
new_parser
->
intern
);
#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_Track
(
new_parser
);
PyObject_GC_Track
(
new_parser
);
#else
PyObject_GC_Init
(
new_parser
);
#endif
if
(
self
->
buffer
!=
NULL
)
{
if
(
self
->
buffer
!=
NULL
)
{
new_parser
->
buffer
=
malloc
(
new_parser
->
buffer_size
);
new_parser
->
buffer
=
malloc
(
new_parser
->
buffer_size
);
...
@@ -1158,12 +1139,7 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
...
@@ -1158,12 +1139,7 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
int
i
;
int
i
;
xmlparseobject
*
self
;
xmlparseobject
*
self
;
#ifdef Py_TPFLAGS_HAVE_GC
/* Code for versions 2.2 and later */
self
=
PyObject_GC_New
(
xmlparseobject
,
&
Xmlparsetype
);
self
=
PyObject_GC_New
(
xmlparseobject
,
&
Xmlparsetype
);
#else
self
=
PyObject_New
(
xmlparseobject
,
&
Xmlparsetype
);
#endif
if
(
self
==
NULL
)
if
(
self
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -1183,11 +1159,7 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
...
@@ -1183,11 +1159,7 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
}
}
self
->
intern
=
intern
;
self
->
intern
=
intern
;
Py_XINCREF
(
self
->
intern
);
Py_XINCREF
(
self
->
intern
);
#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_Track
(
self
);
PyObject_GC_Track
(
self
);
#else
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"
);
...
@@ -1216,11 +1188,7 @@ static void
...
@@ -1216,11 +1188,7 @@ static void
xmlparse_dealloc
(
xmlparseobject
*
self
)
xmlparse_dealloc
(
xmlparseobject
*
self
)
{
{
int
i
;
int
i
;
#ifdef Py_TPFLAGS_HAVE_GC
PyObject_GC_UnTrack
(
self
);
PyObject_GC_UnTrack
(
self
);
#else
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
;
...
@@ -1240,13 +1208,7 @@ xmlparse_dealloc(xmlparseobject *self)
...
@@ -1240,13 +1208,7 @@ xmlparse_dealloc(xmlparseobject *self)
self
->
buffer
=
NULL
;
self
->
buffer
=
NULL
;
}
}
Py_XDECREF
(
self
->
intern
);
Py_XDECREF
(
self
->
intern
);
#ifndef Py_TPFLAGS_HAVE_GC
/* Code for versions 2.0 and 2.1 */
PyObject_Del
(
self
);
#else
/* Code for versions 2.2 and later. */
PyObject_GC_Del
(
self
);
PyObject_GC_Del
(
self
);
#endif
}
}
static
int
static
int
...
@@ -1571,11 +1533,7 @@ static PyTypeObject Xmlparsetype = {
...
@@ -1571,11 +1533,7 @@ static PyTypeObject Xmlparsetype = {
(
getattrofunc
)
xmlparse_getattro
,
/* tp_getattro */
(
getattrofunc
)
xmlparse_getattro
,
/* 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*/
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_HAVE_GC
,
/*tp_flags*/
#else
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_GC
,
/*tp_flags*/
#endif
Xmlparsetype__doc__
,
/* tp_doc - Documentation string */
Xmlparsetype__doc__
,
/* tp_doc - Documentation string */
(
traverseproc
)
xmlparse_traverse
,
/* tp_traverse */
(
traverseproc
)
xmlparse_traverse
,
/* tp_traverse */
(
inquiry
)
xmlparse_clear
,
/* tp_clear */
(
inquiry
)
xmlparse_clear
,
/* tp_clear */
...
...
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