[Python-Dev] KeyboardInterrupt not catch (original) (raw)

Qi Yong qiyong at sosdg.org
Mon Nov 8 02:43:33 CET 2010


Hello,

With this script, after ctrl-d, ctrl-c exception not catch. Is it a python bug or a wrong exception usage? Thanks. If with import readline, this problem disappears.

-- qiyong

def parse(): try: answer = raw_input("Eo: ") print answer except EOFError: print("EOF") except KeyboardInterrupt: print("")

def main(): while True: parse()

if name == "main": main()

-- Qi Yong



More information about the Python-Dev mailing list