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
eff61f69
Commit
eff61f69
authored
Sep 01, 2011
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure to initialize the method wrapper type
parent
a7622858
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
Include/descrobject.h
Include/descrobject.h
+1
-0
Objects/descrobject.c
Objects/descrobject.c
+3
-6
Objects/object.c
Objects/object.c
+3
-0
No files found.
Include/descrobject.h
View file @
eff61f69
...
...
@@ -77,6 +77,7 @@ PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
PyAPI_DATA
(
PyTypeObject
)
PyMethodDescr_Type
;
PyAPI_DATA
(
PyTypeObject
)
PyWrapperDescr_Type
;
PyAPI_DATA
(
PyTypeObject
)
PyDictProxy_Type
;
PyAPI_DATA
(
PyTypeObject
)
_PyMethodWrapper_Type
;
PyAPI_FUNC
(
PyObject
*
)
PyDescr_NewMethod
(
PyTypeObject
*
,
PyMethodDef
*
);
PyAPI_FUNC
(
PyObject
*
)
PyDescr_NewClassMethod
(
PyTypeObject
*
,
PyMethodDef
*
);
...
...
Objects/descrobject.c
View file @
eff61f69
...
...
@@ -846,16 +846,13 @@ PyDictProxy_New(PyObject *dict)
/* This has no reason to be in this file except that adding new files is a
bit of a pain */
/* forward */
static
PyTypeObject
wrappertype
;
typedef
struct
{
PyObject_HEAD
PyWrapperDescrObject
*
descr
;
PyObject
*
self
;
}
wrapperobject
;
#define Wrapper_Check(v) (Py_TYPE(v) == &
wrappert
ype)
#define Wrapper_Check(v) (Py_TYPE(v) == &
_PyMethodWrapper_T
ype)
static
void
wrapper_dealloc
(
wrapperobject
*
wp
)
...
...
@@ -1021,7 +1018,7 @@ wrapper_traverse(PyObject *self, visitproc visit, void *arg)
return
0
;
}
static
PyTypeObject
wrappert
ype
=
{
PyTypeObject
_PyMethodWrapper_T
ype
=
{
PyVarObject_HEAD_INIT
(
&
PyType_Type
,
0
)
"method-wrapper"
,
/* tp_name */
sizeof
(
wrapperobject
),
/* tp_basicsize */
...
...
@@ -1070,7 +1067,7 @@ PyWrapper_New(PyObject *d, PyObject *self)
assert
(
_PyObject_RealIsSubclass
((
PyObject
*
)
Py_TYPE
(
self
),
(
PyObject
*
)
PyDescr_TYPE
(
descr
)));
wp
=
PyObject_GC_New
(
wrapperobject
,
&
wrappert
ype
);
wp
=
PyObject_GC_New
(
wrapperobject
,
&
_PyMethodWrapper_T
ype
);
if
(
wp
!=
NULL
)
{
Py_INCREF
(
descr
);
wp
->
descr
=
descr
;
...
...
Objects/object.c
View file @
eff61f69
...
...
@@ -1625,6 +1625,9 @@ _Py_ReadyTypes(void)
if
(
PyType_Ready
(
&
PyWrapperDescr_Type
)
<
0
)
Py_FatalError
(
"Can't initialize wrapper type"
);
if
(
PyType_Ready
(
&
_PyMethodWrapper_Type
)
<
0
)
Py_FatalError
(
"Can't initialize method wrapper type"
);
if
(
PyType_Ready
(
&
PyEllipsis_Type
)
<
0
)
Py_FatalError
(
"Can't initialize ellipsis type"
);
...
...
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