diff options
| author | Martin v. Löwis <martin@v.loewis.de> | 2002-05-02 20:09:59 +0000 | 
|---|---|---|
| committer | Martin v. Löwis <martin@v.loewis.de> | 2002-05-02 20:09:59 +0000 | 
| commit | edbffc17254cc4f5d441fd9bc1311d4ede81e8da (patch) | |
| tree | ed0281742886850a910aa97c85c6c19009eec433 /Modules/arraymodule.c | |
| parent | d9018323c035b3c5127d635f237f0009a060053a (diff) | |
| download | cpython-git-edbffc17254cc4f5d441fd9bc1311d4ede81e8da.tar.gz | |
Patch #551009: Initialize array type dynamically.
Diffstat (limited to 'Modules/arraymodule.c')
| -rw-r--r-- | Modules/arraymodule.c | 9 | 
1 files changed, 6 insertions, 3 deletions
| diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 1aa76dc526..0653e89246 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1697,7 +1697,7 @@ statichere PyTypeObject Arraytype = {  	0, 					/* tp_hash */  	0,					/* tp_call */  	0,					/* tp_str */ -	PyObject_GenericGetAttr,		/* tp_getattro */ +	0,					/* tp_getattro */  	0,					/* tp_setattro */  	&array_as_buffer,			/* tp_as_buffer*/  	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,  /* tp_flags */ @@ -1717,9 +1717,9 @@ statichere PyTypeObject Arraytype = {  	0,					/* tp_descr_set */  	0,					/* tp_dictoffset */  	0,					/* tp_init */ -	PyType_GenericAlloc,			/* tp_alloc */ +	0,					/* tp_alloc */  	array_new,				/* tp_new */ -	PyObject_Del,	                 	/* tp_free */ +	0,					/* tp_free */  };  /* No functions in array module. */ @@ -1734,6 +1734,9 @@ initarray(void)  	PyObject *m;  	Arraytype.ob_type = &PyType_Type; +	Arraytype.tp_getattro = PyObject_GenericGetAttr; +	Arraytype.tp_alloc = PyType_GenericAlloc; +	Arraytype.tp_free = PyObject_Del;  	m = Py_InitModule3("array", a_methods, module_doc);          Py_INCREF((PyObject *)&Arraytype); | 
