Follow up on pull request 21. Since PyCapsule_GetPointer returns NULL on error, we should check if the list element is Py_None.

This commit is contained in:
Siu Kwan Lam 2012-09-14 18:42:49 -07:00
commit 56796cad61
2 changed files with 11 additions and 1 deletions

View file

@ -1456,6 +1456,9 @@ class Function(GlobalValue):
class MetaData(Value):
@staticmethod
def get(module, values):
'''
values -- must be an iterable of Constant or None. None is treated as "null".
'''
vs = unpack_values_or_none(values)
ptr = _core.LLVMMetaDataGet(module.ptr, vs)
return MetaData(ptr)