summaryrefslogtreecommitdiffstats
path: root/gobject
diff options
context:
space:
mode:
Diffstat (limited to 'gobject')
-rw-r--r--gobject/gobjectmodule.c6
-rw-r--r--gobject/pygflags.c23
-rw-r--r--gobject/pygobject.h2
-rw-r--r--gobject/pygtype.c3
4 files changed, 8 insertions, 26 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 267546f..90b4d1e 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -2610,7 +2610,8 @@ pygobject_register_warnings(PyObject *d)
}
-PYGLIB_MODULE_START(_gobject, "gobject._gobject")
+//PYGLIB_MODULE_START(_gobject, "gobject._gobject")
+PYGLIB_INIT_FUNCTION(_gobject, "gobject._gobject", _gobject_functions)
{
PyObject *d;
@@ -2638,5 +2639,6 @@ PYGLIB_MODULE_START(_gobject, "gobject._gobject")
pygobject_api_functions.threads_enabled = pyglib_threads_enabled();
_pyglib_notify_on_enabling_threads(pyg_note_threads_enabled);
+
+ return 0;
}
-PYGLIB_MODULE_END
diff --git a/gobject/pygflags.c b/gobject/pygflags.c
index 1865abb..abac423 100644
--- a/gobject/pygflags.c
+++ b/gobject/pygflags.c
@@ -439,7 +439,7 @@ static PyNumberMethods pyg_flags_as_number = {
(binaryfunc)pyg_flags_warn, /* nb_multiply */
(binaryfunc)pyg_flags_warn, /* nb_divide */
(binaryfunc)pyg_flags_warn, /* nb_remainder */
- (binaryfunc)pyg_flags_warn, /* nb_divmod */
+// (binaryfunc)pyg_flags_warn, /* nb_divmod */
(ternaryfunc)pyg_flags_warn, /* nb_power */
0, /* nb_negative */
0, /* nb_positive */
@@ -451,27 +451,6 @@ static PyNumberMethods pyg_flags_as_number = {
(binaryfunc)pyg_flags_and, /* nb_and */
(binaryfunc)pyg_flags_xor, /* nb_xor */
(binaryfunc)pyg_flags_or, /* nb_or */
- 0, /* nb_coerce */
- 0, /* nb_int */
- 0, /* nb_long */
- 0, /* nb_float */
- 0, /* nb_oct */
- 0, /* nb_hex */
- 0, /* nb_inplace_add */
- 0, /* nb_inplace_subtract */
- 0, /* nb_inplace_multiply */
- 0, /* nb_inplace_divide */
- 0, /* nb_inplace_remainder */
- 0, /* nb_inplace_power */
- 0, /* nb_inplace_lshift */
- 0, /* nb_inplace_rshift */
- 0, /* nb_inplace_and */
- 0, /* nb_inplace_xor */
- 0, /* nb_inplace_or */
- 0, /* nb_floor_divide */
- 0, /* nb_true_divide */
- 0, /* nb_inplace_floor_divide */
- 0, /* nb_inplace_true_divide */
};
void
diff --git a/gobject/pygobject.h b/gobject/pygobject.h
index aaab860..e3c3df1 100644
--- a/gobject/pygobject.h
+++ b/gobject/pygobject.h
@@ -320,7 +320,7 @@ pygobject_init(int req_major, int req_minor, int req_micro)
Py_XDECREF(traceback);
PyErr_Format(PyExc_ImportError,
"could not import gobject (error was: %s)",
- PyString_AsString(py_orig_exc));
+ _PyUnicode_AsString(py_orig_exc));
Py_DECREF(py_orig_exc);
} else {
PyErr_SetString(PyExc_ImportError,
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index aff6287..3915f8f 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -907,7 +907,8 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj)
GString *string;
char *buffer;
Py_ssize_t len;
- if (_PyUnicode_AsStringAndSize(obj, &buffer, &len))
+ buffer = _PyUnicode_AsStringAndSize(obj, &buffer, &len);
+ if (buffer == NULL)
return -1;
string = g_string_new_len(buffer, len);
g_value_set_boxed(value, string);