This is an archive of the discontinued LLVM Phabricator instance.

[bindings] allow null strings in Python 3
ClosedPublic

Authored by frutiger on Sep 14 2017, 11:00 AM.

Details

Reviewers
compnerd
Summary

Some API calls accept 'NULL' instead of a char array (e.g. the second
argument to 'clang_ParseTranslationUnit'). For Python 3 compatibility,
all strings are passed through 'c_interop_string' which expects to
receive only 'bytes' or 'str' objects. This change extends this
behavior to additionally allow 'None' to be supplied.

A test case was added which breaks in Python 3, and is fixed by this
change. All the test cases pass in both, Python 2 and Python 3.

Diff Detail

Event Timeline

frutiger created this revision.Sep 14 2017, 11:00 AM

Friendly poke!

compnerd accepted this revision.Sep 27 2017, 9:22 PM
This revision is now accepted and ready to land.Sep 27 2017, 9:22 PM