From 97a35ad4bf0623636459735e119d1b0fe0ede5ff Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Mon, 12 Apr 2010 23:51:24 -0400 Subject: Remove remaining PyInt & PyString calls --- gobject/gobjectmodule.c | 6 +++--- gobject/pygobject.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gobject') diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index d431d6a..9a10be5 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -140,7 +140,7 @@ pyg_type_from_name (PyObject *self, PyObject *args) if (type != 0) return pyg_type_wrapper_new(type); repr = PyObject_Repr((PyObject*)self); - repr_ptr = (repr ? PyString_AsString(repr) : ""); + repr_ptr = (repr ? _PyUnicode_AsString(repr) : ""); PyErr_Format(PyExc_RuntimeError, "%s: unknown type name: %s", (repr_ptr ? repr_ptr : ""), name); Py_CLEAR(repr); @@ -1926,7 +1926,7 @@ pyg_add_emission_hook(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, gtype, &sigid, &detail, TRUE)) { PyObject *repr = PyObject_Repr((PyObject*)self); - const char *repr_ptr = (repr ? PyString_AsString(repr) : ""); + const char *repr_ptr = (repr ? _PyUnicode_AsString(repr) : ""); PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", (repr_ptr ? repr_ptr : ""), name); Py_CLEAR(repr); @@ -1967,7 +1967,7 @@ pyg_remove_emission_hook(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, gtype, &signal_id, NULL, TRUE)) { PyObject *repr = PyObject_Repr((PyObject*)self); - const char *repr_ptr = (repr ? PyString_AsString(repr) : ""); + const char *repr_ptr = (repr ? _PyUnicode_AsString(repr) : ""); PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", (repr_ptr ? repr_ptr : ""), name); Py_CLEAR(repr); diff --git a/gobject/pygobject.c b/gobject/pygobject.c index 28a2a37..33cb927 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -1723,7 +1723,7 @@ pygobject_emit(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, G_OBJECT_TYPE(self->obj), &signal_id, &detail, TRUE)) { PyObject *repr = PyObject_Repr((PyObject*)self); - const char* ptr = (repr ? PyString_AsString(repr) : ""); + const char* ptr = (repr ? _PyUnicode_AsString(repr) : ""); PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", (ptr ? ptr : ""), name); Py_CLEAR(repr); @@ -1801,7 +1801,7 @@ pygobject_stop_emission(PyGObject *self, PyObject *args) if (!g_signal_parse_name(signal, G_OBJECT_TYPE(self->obj), &signal_id, &detail, TRUE)) { PyObject *repr = PyObject_Repr((PyObject*)self); - const char* ptr = (repr ? PyString_AsString(repr) : ""); + const char* ptr = (repr ? _PyUnicode_AsString(repr) : ""); PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", (ptr ? ptr : ""), signal); Py_CLEAR(repr); @@ -1951,7 +1951,7 @@ pygobject_disconnect_by_func(PyGObject *self, PyObject *args) closure = gclosure_from_pyfunc(self, pyfunc); if (!closure) { PyObject *repr = PyObject_Repr(pyfunc); - const char* ptr = (repr ? PyString_AsString(repr) : ""); + const char* ptr = (repr ? _PyUnicode_AsString(repr) : ""); PyErr_Format(PyExc_TypeError, "nothing connected to %s", (ptr ? ptr : "")); Py_CLEAR(repr); @@ -1986,7 +1986,7 @@ pygobject_handler_block_by_func(PyGObject *self, PyObject *args) closure = gclosure_from_pyfunc(self, pyfunc); if (!closure) { PyObject *repr = PyObject_Repr(pyfunc); - const char* ptr = (repr ? PyString_AsString(repr) : ""); + const char* ptr = (repr ? _PyUnicode_AsString(repr) : ""); PyErr_Format(PyExc_TypeError, "nothing connected to %s", (ptr ? ptr : "")); Py_CLEAR(repr); @@ -2021,7 +2021,7 @@ pygobject_handler_unblock_by_func(PyGObject *self, PyObject *args) closure = gclosure_from_pyfunc(self, pyfunc); if (!closure) { PyObject *repr = PyObject_Repr(pyfunc); - const char* ptr = (repr ? PyString_AsString(repr) : ""); + const char* ptr = (repr ? _PyUnicode_AsString(repr) : ""); PyErr_Format(PyExc_TypeError, "nothing connected to %s", (ptr ? ptr : "")); Py_CLEAR(repr); -- cgit