Fix a Python 3 incompatibility in the SWIG bindings.

Change: 113579944
This commit is contained in:
A. Unique TensorFlower 2016-02-01 16:17:11 -08:00 committed by Manjunath Kudlur
parent d821f6aeb6
commit 5ff6d34a05

View File

@ -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;
}
}