Ticket #4609: bytes_to_string.patch

File bytes_to_string.patch, 675 bytes (added by Haoyu Bai, 12 years ago)
  • libs/python/src/converter/builtin_converters.cpp

     
    375375      static unaryfunc* get_slot(PyObject* obj)
    376376      {
    377377#if PY_VERSION_HEX >= 0x03000000
    378           return (PyUnicode_Check(obj)) ? &py_unicode_as_string_unaryfunc : 0;
     378          return (PyUnicode_Check(obj)) ? &py_unicode_as_string_unaryfunc :
     379                  PyBytes_Check(obj) ? &py_object_identity : 0;
    379380#else
    380381          return (PyString_Check(obj)) ? &obj->ob_type->tp_str : 0;
    381382