This is an archive of the discontinued LLVM Phabricator instance.

Update swig typemaps and interfaces to not call PyString_FromStringAndSize
ClosedPublic

Authored by zturner on Oct 13 2015, 1:26 PM.

Details

Summary

Python 3's native API has a number of incompatibilities with Python 2's. Most of these incompatibilities are hidden inside of the various PythonObject classes, but our swig typemaps and interfaces use Python native APIs directly.

This patch addresses the first of these incompatibilities, the use of PyString_FromStringAndSize. It is fixed by changing these to use `PythonString. It's possible more work may need to be done here in the future because there are still numerous calls to native Python APIs from the swig typemaps, but for now this is the minimum amount of work necessary to get a successful compilation under Python 3.

The second of these incompatibilities, the use of various PyFile_xxx functions, will be addressed in a followup patch.

Diff Detail

Event Timeline

zturner updated this revision to Diff 37282.Oct 13 2015, 1:26 PM
zturner retitled this revision from to Update swig typemaps and interfaces to not call PyString_FromStringAndSize.
zturner updated this object.
zturner added reviewers: clayborg, granata.enrico.
zturner added a subscriber: lldb-commits.
clayborg accepted this revision.Oct 13 2015, 2:23 PM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Oct 13 2015, 2:23 PM
zturner closed this revision.Oct 15 2015, 1:45 PM