diff options
-rw-r--r-- | numpy/dual.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/numpy/dual.py b/numpy/dual.py index 00a1f04fa..e6e8884b5 100644 --- a/numpy/dual.py +++ b/numpy/dual.py @@ -43,7 +43,13 @@ def restore_func(name): if name not in __all__: raise ValueError, "%s not a dual function." % name try: - sys._getframe(0).f_globals[name] = _restore_dict[name] + val = _restore_dict[name] except KeyError: - pass - + return + else: + sys._getframe(0).f_globals[name] = val + +def restore_all(): + for name in _restore_dict.keys(): + restore_func(name) + |