Skip to content

Commit 6389314

Browse files
committed
added fix for some ansi issues as described in diíscussion bruderstein#36 (comment)
1 parent 48d96a7 commit 6389314

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

PythonScript/src/ScintillaWrapper.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ std::string ScintillaWrapper::getStringFromObject(boost::python::object o)
5757
{
5858
boost::python::object utf8Text = o.attr("__str__")();
5959
raw = std::string(boost::python::extract<const char *>(utf8Text));
60-
}
60+
}
61+
else if (PyBytes_CheckExact(o.ptr()))
62+
{
63+
raw.assign(PyBytes_AsString(o.ptr()), PyBytes_Size(o.ptr()));
64+
}
6165
else
6266
{
6367
boost::python::object rawString = o.attr("__str__")();

0 commit comments

Comments
 (0)