From 7dad804572629bc3ba33f7bce472509572089d70 2010-10-26 08:42:44 From: Erik Tollerud Date: 2010-10-26 08:42:44 Subject: [PATCH] fixed bug introduced into builtin_trap due to 'quit' being removed twice - test suit now passes --- diff --git a/IPython/core/builtin_trap.py b/IPython/core/builtin_trap.py index e2d3a4b..6eccc29 100755 --- a/IPython/core/builtin_trap.py +++ b/IPython/core/builtin_trap.py @@ -80,10 +80,12 @@ class BuiltinTrap(Configurable): """Add a builtin and save the original.""" bdict = __builtin__.__dict__ orig = bdict.get(key, BuiltinUndefined) - self._orig_builtins[key] = orig if value is HideBuiltin: - del bdict[key] + if orig is not BuiltinUndefined: #same as 'key in bdict' + self._orig_builtins[key] = orig + del bdict[key] else: + self._orig_builtins[key] = orig bdict[key] = value def remove_builtin(self, key):