Fix a Python 3 incompatibility in the SWIG bindings.
Change: 113579944
This commit is contained in:
parent
d821f6aeb6
commit
5ff6d34a05
@ -208,7 +208,12 @@ tensorflow::ImportNumpy();
|
||||
RaiseStatusNotOK(*$1, $descriptor(tensorflow::Status*));
|
||||
SWIG_fail;
|
||||
} else {
|
||||
$result = PyString_FromStringAndSize(*$2, strlen(*$2));
|
||||
%#if PY_MAJOR_VERSION < 3
|
||||
$result = PyString_FromStringAndSize(
|
||||
%#else
|
||||
$result = PyUnicode_FromStringAndSize(
|
||||
%#endif
|
||||
*$2, strlen(*$2));
|
||||
delete *$2;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user