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