Skip to content

Commit

Permalink
fix init issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalkjha committed Dec 30, 2024
1 parent 4aa4d6a commit 2b26cdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ibm_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -15622,7 +15622,7 @@ static PyMethodDef ibm_db_Methods[] = {
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"ibm_db",
"ibm_db2",
"IBM DataServer Driver for Python.",
-1,
ibm_db_Methods,
Expand All @@ -15631,7 +15631,7 @@ static struct PyModuleDef moduledef = {

/* Module initialization function */
PyMODINIT_FUNC
INIT_ibm_db(void) {
INIT_ibm_db2(void) {
PyObject* m;

PyDateTime_IMPORT;
Expand Down Expand Up @@ -15659,7 +15659,7 @@ INIT_ibm_db(void) {
return MOD_RETURN_ERROR;

#if PY_MAJOR_VERSION < 3
m = Py_InitModule3("ibm_db", ibm_db_Methods, "IBM DataServer Driver for Python.");
m = Py_InitModule3("ibm_db2", ibm_db_Methods, "IBM DataServer Driver for Python.");
#else
m = PyModule_Create(&moduledef);
#endif
Expand Down
4 changes: 2 additions & 2 deletions ibm_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define MOD_RETURN_ERROR
#define MOD_RETURN_VAL(mod)
#define INIT_ibm_db initibm_db
#define INIT_ibm_db2 initibm_db2
#else
#define PyInt_Check PyLong_Check
#define PyInt_FromLong PyLong_FromLong
Expand All @@ -50,7 +50,7 @@
#define StringObj_Size PyUnicode_GET_LENGTH
#define MOD_RETURN_ERROR NULL
#define MOD_RETURN_VAL(mod) mod
#define INIT_ibm_db PyInit_ibm_db
#define INIT_ibm_db2 PyInit_ibm_db2
#endif

#define NUM2LONG(data) PyInt_AsLong(data)
Expand Down

0 comments on commit 2b26cdd

Please sign in to comment.