Check if the user has set the '_' variable by hand.
(self)
| 71 | #------------------------------------------------------------------------- |
| 72 | |
| 73 | def check_for_underscore(self): |
| 74 | """Check if the user has set the '_' variable by hand.""" |
| 75 | # If something injected a '_' variable in __builtin__, delete |
| 76 | # ipython's automatic one so we don't clobber that. gettext() in |
| 77 | # particular uses _, so we need to stay away from it. |
| 78 | if '_' in builtin_mod.__dict__: |
| 79 | try: |
| 80 | user_value = self.shell.user_ns['_'] |
| 81 | if user_value is not self._: |
| 82 | return |
| 83 | del self.shell.user_ns['_'] |
| 84 | except KeyError: |
| 85 | pass |
| 86 | |
| 87 | def quiet(self): |
| 88 | """Should we silence the display hook because of ';'?""" |