Skip to content

Commit

Permalink
Make sure module has a name
Browse files Browse the repository at this point in the history
  • Loading branch information
wanders committed Sep 12, 2013
1 parent 79f6ce3 commit 12457c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bindings/python/llvm/core/module.py
Expand Up @@ -46,6 +46,9 @@ def __init__(self, name=None, context=None, ptr=None):
if context is None:
context = Context.GetGlobalContext()

if name is None:
raise ValueError("Module must have a name")

ptr = lib.LLVMModuleCreateWithNameInContext(name, context)

LLVMObject.__init__(self, ptr=ptr)
Expand Down

0 comments on commit 12457c9

Please sign in to comment.