This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cdcarter
Recipients
Date 2006-11-21.03:52:02
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
When i type 'quit' in the interpreter, i get a nice little class and method yelling at me, instead of just quitting.

PATCH:
<pre>
def setquit():

    class Quitter(object):
        def __init__(self, name):
            self.name = name
        def __repr__(self):
            quit()
        def __call__(self, code=None):
            # Shells like IDLE catch the SystemExit, but listen when their
            # stdin wrapper is closed.
            try:
                sys.stdin.close()
            except:
                pass
            raise SystemExit(code)
    __builtin__.quit = Quitter('quit')
    __builtin__.exit = Quitter('exit')
</pre>
History
Date User Action Args
2007-08-23 14:50:11adminlinkissue1600157 messages
2007-08-23 14:50:11admincreate