Show More
@@ -80,10 +80,12 b' class BuiltinTrap(Configurable):' | |||||
80 | """Add a builtin and save the original.""" |
|
80 | """Add a builtin and save the original.""" | |
81 | bdict = __builtin__.__dict__ |
|
81 | bdict = __builtin__.__dict__ | |
82 | orig = bdict.get(key, BuiltinUndefined) |
|
82 | orig = bdict.get(key, BuiltinUndefined) | |
83 | self._orig_builtins[key] = orig |
|
|||
84 | if value is HideBuiltin: |
|
83 | if value is HideBuiltin: | |
85 | del bdict[key] |
|
84 | if orig is not BuiltinUndefined: #same as 'key in bdict' | |
|
85 | self._orig_builtins[key] = orig | |||
|
86 | del bdict[key] | |||
86 | else: |
|
87 | else: | |
|
88 | self._orig_builtins[key] = orig | |||
87 | bdict[key] = value |
|
89 | bdict[key] = value | |
88 |
|
90 | |||
89 | def remove_builtin(self, key): |
|
91 | def remove_builtin(self, key): |
General Comments 0
You need to be logged in to leave comments.
Login now