Skip to content

Commit

Permalink
SF Patch python#103185, by jlt63: Some more standard modules cleanup …
Browse files Browse the repository at this point in the history
…for Cygwin
  • Loading branch information
gvanrossum committed Jan 22, 2001
1 parent 31584cb commit a120ffc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Modules/_curses_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name)
/* -------------------------------------------------------*/

PyTypeObject PyCursesPanel_Type = {
PyObject_HEAD_INIT(&PyType_Type)
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"curses panel", /*tp_name*/
sizeof(PyCursesPanelObject), /*tp_basicsize*/
Expand Down Expand Up @@ -469,11 +469,14 @@ static PyMethodDef PyCurses_methods[] = {

/* Initialization function for the module */

void
DL_EXPORT(void)
init_curses_panel(void)
{
PyObject *m, *d, *v;

/* Initialize object type */
PyCursesPanel_Type.ob_type = &PyType_Type;

import_curses();

/* Create the module and add the functions */
Expand Down
3 changes: 2 additions & 1 deletion Modules/dbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ dbm_getattr(dbmobject *dp, char *name)
}

static PyTypeObject Dbmtype = {
PyObject_HEAD_INIT(&PyType_Type)
PyObject_HEAD_INIT(NULL)
0,
"dbm",
sizeof(dbmobject),
Expand Down Expand Up @@ -342,6 +342,7 @@ DL_EXPORT(void)
initdbm(void) {
PyObject *m, *d, *s;

Dbmtype.ob_type = &PyType_Type;
m = Py_InitModule("dbm", dbmmodule_methods);
d = PyModule_GetDict(m);
if (DbmError == NULL)
Expand Down
5 changes: 4 additions & 1 deletion Modules/regexmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ regobj_getattr(regexobject *re, char *name)
}

static PyTypeObject Regextype = {
PyObject_HEAD_INIT(&PyType_Type)
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"regex", /*tp_name*/
sizeof(regexobject), /*tp_size*/
Expand Down Expand Up @@ -654,6 +654,9 @@ initregex(void)
int i;
char *s;

/* Initialize object type */
Regextype.ob_type = &PyType_Type;

m = Py_InitModule("regex", regex_global_methods);
d = PyModule_GetDict(m);

Expand Down
5 changes: 4 additions & 1 deletion Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,7 @@ static PyObject *SSL_getattr(SSLObject *self, char *name)
}

staticforward PyTypeObject SSL_Type = {
PyObject_HEAD_INIT(&PyType_Type)
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"SSL", /*tp_name*/
sizeof(SSLObject), /*tp_basicsize*/
Expand Down Expand Up @@ -2381,6 +2381,9 @@ init_socket(void)
return;
#endif /* __TOS_OS2__ */
#endif /* MS_WINDOWS */
#ifdef USE_SSL
SSL_Type.ob_type = &PyType_Type;
#endif
m = Py_InitModule3("_socket", PySocket_methods, module_doc);
d = PyModule_GetDict(m);
PySocket_Error = PyErr_NewException("socket.error", NULL, NULL);
Expand Down

0 comments on commit a120ffc

Please sign in to comment.