Reimplemented FunctionAlreadyExists and usage (Exceptions are not iterable in Python 3)
This commit is contained in:
parent
b8da3c7a73
commit
bd129baa0a
1 changed files with 4 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue