MetaData operands can be None. Handle this.

This commit is contained in:
Wladimir J. van der Laan 2012-09-14 16:59:30 +02:00
commit c94e852c0e
3 changed files with 16 additions and 4 deletions

View file

@ -62,6 +62,11 @@ def unpack_gen(objlist, check_fn):
for obj in objlist: check_fn(obj)
return [ obj.ptr for obj in objlist ]
def unpack_gen_allow_none(objlist, check_fn):
for obj in objlist:
if obj is not None:
check_fn(obj)
return [ (obj.ptr if obj is not None else None) for obj in objlist ]
#===----------------------------------------------------------------------===
# Helper to wrap over iterables (LLVMFirstXXX, LLVMNextXXX). This used