diff options
Diffstat (limited to 'plugins/python/python.c')
-rw-r--r-- | plugins/python/python.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/python/python.c b/plugins/python/python.c index 4ea34c23..0fed65ca 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -88,8 +88,10 @@ #undef PyUnicode_Check #undef PyUnicode_FromString +#undef PyUnicode_FromFormat #define PyUnicode_Check PyString_Check #define PyUnicode_AsFormat PyString_AsFormat +#define PyUnicode_FromFormat PyString_FromFormat #define PyUnicode_FromString PyString_FromString #define PyUnicode_AsUTF8 PyString_AsString @@ -1502,7 +1504,10 @@ Module_hexchat_get_info(PyObject *self, PyObject *args) Py_INCREF(Py_None); return Py_None; } - return PyUnicode_FromString(info); + if (strcmp (name, "gtkwin_ptr") == 0) + return PyUnicode_FromFormat("%p", info); /* format as pointer */ + else + return PyUnicode_FromString(info); } static PyObject * @@ -2157,6 +2162,7 @@ IInterp_Exec(char *command) memcpy(buffer, command, len); buffer[len] = '\n'; buffer[len+1] = 0; + PyRun_SimpleString("import hexchat"); o = PyRun_StringFlags(buffer, Py_single_input, d, d, NULL); g_free(buffer); if (o == NULL) { |