A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-December/059186.html below:

[Python-Dev] a quit that actually quits

[Python-Dev] a quit that actually quits [Python-Dev] a quit that actually quitsskip@pobox.com skip at pobox.com
Wed Dec 28 14:08:12 CET 2005
    Fredrik>     if isinstance(exc_value, NameError) and not exc_info.tb_next:
    Fredrik>         text = exc_value[0]
    Fredrik>         name = ... extract name from nameerror string ...
    Fredrik>         if sys.commandline.strip() == name:
    Fredrik>             if name in ("exit", "quit"):
    Fredrik>                 raise SystemExit
    Fredrik>             if name == "help":
    Fredrik>                 help()
    Fredrik>                 return
    Fredrik>     ...

    Fredrik> any suggestions on how to improve this ?

I'd make it sys._last_input or something similar to make it clear that a)
this is magic, don't mess with it, and that b) this is the last user input,
not the raw command line.

Skip
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4