diff options
| author | Ian Ward <ian@excess.org> | 2011-02-16 13:43:24 -0500 |
|---|---|---|
| committer | Ian Ward <ian@excess.org> | 2011-02-16 13:43:24 -0500 |
| commit | 724eaf59d26f5a522febbbf4ac1694075f38b17f (patch) | |
| tree | ebb31c0fb27c3d15593302691c5fcb058a8e7555 /source/str_util.c | |
| parent | 9e43136d9027a8e175dfcb064ebfe16718c222a7 (diff) | |
| download | urwid-724eaf59d26f5a522febbbf4ac1694075f38b17f.tar.gz | |
fix for is_wide_char
--HG--
branch : python3
Diffstat (limited to 'source/str_util.c')
| -rw-r--r-- | source/str_util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/str_util.c b/source/str_util.c index 3305c28..e1b6640 100644 --- a/source/str_util.c +++ b/source/str_util.c @@ -485,8 +485,11 @@ static int Py_IsWideChar(PyObject *text, Py_ssize_t offs) return (Py_GetWidth((long int)ustr[offs]) == 2); } - if ( text->ob_type != Py_BuildValue("s","")->ob_type ) { - +#ifndef PYTHON3 + if (!PyString_Check(text)) { +#else + if (!PyBytes_Check(text)) { +#endif PyErr_SetString(PyExc_TypeError, "is_wide_char: Argument \"text\" is not a string."); return -1; |
