diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2019-05-22 15:57:08 +0300 |
---|---|---|
committer | Florian Festi <ffesti@redhat.com> | 2019-05-27 14:08:41 +0200 |
commit | 1d6fde768cf4ca731e1afcd2ad67bdd5bb2e6742 (patch) | |
tree | f8b26ee1d9881f711cf90470f91c7ea6c97e82bd /python/rpmsystem-py.h | |
parent | dbb12c6231707830d8fbdd1fd58249f3eb784f8b (diff) | |
download | rpm-1d6fde768cf4ca731e1afcd2ad67bdd5bb2e6742.tar.gz |
Un-inline utf8FromString() python helper now that we can
Since commit 73a41da965337aaacabd53924f1b67b967e0476e this doesn't need
to be inline with murky linkage across different modules. With this,
it'd now be possible to add some central control too if we wanted.
Diffstat (limited to 'python/rpmsystem-py.h')
-rw-r--r-- | python/rpmsystem-py.h | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h index 25938464a..e6fdbfe24 100644 --- a/python/rpmsystem-py.h +++ b/python/rpmsystem-py.h @@ -19,17 +19,6 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #endif -static inline PyObject * utf8FromString(const char *s) -{ -/* In Python 3, we return all strings as surrogate-escaped utf-8 */ -#if PY_MAJOR_VERSION >= 3 - if (s != NULL) - return PyUnicode_DecodeUTF8(s, strlen(s), "surrogateescape"); -#else - if (s != NULL) - return PyBytes_FromString(s); -#endif - Py_RETURN_NONE; -} +PyObject * utf8FromString(const char *s); #endif /* H_SYSTEM_PYTHON */ |