diff options
author | Eric Jones <eric@enthought.com> | 2002-01-22 20:43:22 +0000 |
---|---|---|
committer | Eric Jones <eric@enthought.com> | 2002-01-22 20:43:22 +0000 |
commit | 227c397f7f597f58dc068e98021d4805b667e642 (patch) | |
tree | 69c37e708602c3da4693af19110827e4fe4929c2 /weave/inline_tools.py | |
parent | e03b4d87272bdd651612d91bd68b4d1d78b5a97e (diff) | |
download | numpy-227c397f7f597f58dc068e98021d4805b667e642.tar.gz |
several issues with tuple,dict,and list conversions were solved. Also, NameError is now caught and checked for ConversionError in inline_tools. This can be an issue when something like inline("",['a']) is called and then inline("",['b']) is called. It hadn't occured to me that the names had to be the same from call to call, but I guess they do or we get a recompile.
Diffstat (limited to 'weave/inline_tools.py')
-rw-r--r-- | weave/inline_tools.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/weave/inline_tools.py b/weave/inline_tools.py index 7b0e3ed78..6c6cba156 100644 --- a/weave/inline_tools.py +++ b/weave/inline_tools.py @@ -296,12 +296,18 @@ def inline(code,arg_names=[],local_dict = None, global_dict = None, try: results = apply(function_cache[code],(local_dict,global_dict)) return results - except TypeError, msg: # should specify argument types here. - msg = str(msg) + except TypeError, msg: + msg = str(msg).strip() if msg[:16] == "Conversion Error": pass else: raise TypeError, msg + except NameError, msg: + msg = str(msg).strip() + if msg[:16] == "Conversion Error": + pass + else: + raise NameError, msg except KeyError: pass # 2. try function catalog @@ -347,7 +353,12 @@ def attempt_function_call(code,local_dict,global_dict): pass else: raise TypeError, msg - + except NameError, msg: + msg = str(msg).strip() + if msg[:16] == "Conversion Error": + pass + else: + raise NameError, msg # 3. try persistent catalog module_dir = global_dict.get('__file__',None) function_list = function_catalog.get_functions(code,module_dir) |