diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-09-14 15:25:11 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:14 -0300 |
commit | dfd3c75a8ba6bc8a1ac42909d96bc6d4c11c6bd7 (patch) | |
tree | a4df32a57533616d7b7f975d23d0ca9d9cd0f3af /libshiboken/helper.cpp | |
parent | 31c44fea50380513bdc16d58891ba9e5ba7ecc31 (diff) |
Replaced all PyString_* by PyBytes_* as preparation for a Python 3.x port.
Diffstat (limited to 'libshiboken/helper.cpp')
-rw-r--r-- | libshiboken/helper.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libshiboken/helper.cpp b/libshiboken/helper.cpp index 99b176447..4a7df66cd 100644 --- a/libshiboken/helper.cpp +++ b/libshiboken/helper.cpp @@ -39,7 +39,7 @@ bool sequenceToArgcArgv(PyObject* argList, int* argc, char*** argv, const char* int numArgs = PySequence_Fast_GET_SIZE(argList); for (int i = 0; i < numArgs; ++i) { PyObject* item = PySequence_Fast_GET_ITEM(args.object(), i); - if (!PyString_Check(item) && !PyUnicode_Check(item)) + if (!PyBytes_Check(item) && !PyUnicode_Check(item)) return false; } @@ -54,16 +54,16 @@ bool sequenceToArgcArgv(PyObject* argList, int* argc, char*** argv, const char* // Try to get the script name PyObject* globals = PyEval_GetGlobals(); PyObject* appName = PyDict_GetItemString(globals, "__file__"); - (*argv)[0] = strdup(appName ? PyString_AS_STRING(appName) : defaultAppName); + (*argv)[0] = strdup(appName ? PyBytes_AS_STRING(appName) : defaultAppName); } else { for (int i = 0; i < numArgs; ++i) { PyObject* item = PySequence_Fast_GET_ITEM(args.object(), i); char* string; if (PyUnicode_Check(item)) { Shiboken::AutoDecRef utf8(PyUnicode_AsUTF8String(item)); - string = strdup(PyString_AS_STRING(utf8.object())); + string = strdup(PyBytes_AS_STRING(utf8.object())); } else { - string = strdup(PyString_AS_STRING(item)); + string = strdup(PyBytes_AS_STRING(item)); } (*argv)[i] = string; } |