Please sign in to comment.
Add quitter checker and handler for quit(), etc. calls. Closes gh-142.
After some discussion with Fernando it was decided that detecting calls on all magics as in pull request #352 was probably overkill. Opted for detecting with a regex possible calls to absent Quitter objects and rewriting them (as before), with visual notification of this rewrite. This is done with a QuitterChecker which has priority just below that of AutoMagicChecker. The only case where you will get a NameError now is if you input newlines before the starting and closing paren, but that's sufficiently crazy as to not be worth considering (it takes one, optional, integer argument in the real Python shell, why you'd ever need newlines...). Also subclassed MagicHandler to avoid doing the regex check twice (once in the Checker and once in the Handler) and factored out the creation of the replacement command so as to avoid potential code rot.
- Loading branch information...