From bd129baa0a4413f5872baf8981a92c78ecd27a01 Mon Sep 17 00:00:00 2001 From: Hernan Grecco Date: Mon, 11 Mar 2013 15:51:03 -0300 Subject: [PATCH] Reimplemented FunctionAlreadyExists and usage (Exceptions are not iterable in Python 3) --- llvm_cbuilder/builder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm_cbuilder/builder.py b/llvm_cbuilder/builder.py index 9b970f4..648f384 100644 --- a/llvm_cbuilder/builder.py +++ b/llvm_cbuilder/builder.py @@ -14,7 +14,9 @@ from . import shortnames as types ### class FunctionAlreadyExists(NameError): - pass + + def __init__(self, func): + self.func = func def _is_int(ty): return isinstance(ty, lc.IntegerType) @@ -830,7 +832,7 @@ class CDefinition(object): try: func = self.define(module) except FunctionAlreadyExists as e: - (func,) = e + func = e.func return func def __getattr__(self, attr):