2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-27 07:02:15 +00:00

attempt unverified workaround for http://tinyurl.com/gvrgd

[SVN r35103]
This commit is contained in:
Dave Abrahams
2006-09-13 22:47:11 +00:00
parent 924eeccd53
commit 326c871224

View File

@@ -304,13 +304,16 @@ namespace
static std::wstring extract(PyObject* intermediate)
{
std::wstring result(::PyObject_Length(intermediate), L' ');
int err = PyUnicode_AsWideChar(
(PyUnicodeObject *)intermediate
, result.size() ? &result[0] : 0
, result.size());
if (!result.empty())
{
int err = PyUnicode_AsWideChar(
(PyUnicodeObject *)intermediate
, &result[0]
, result.size());
if (err == -1)
throw_error_already_set();
if (err == -1)
throw_error_already_set();
}
return result;
}
};