Re: Handle SystemExit exception

2009-02-01 Thread asit
Thanx everyone This is my fault. Exception was thrown before the main function. -- http://mail.python.org/mailman/listinfo/python-list

Re: Handle SystemExit exception

2009-02-01 Thread Steven D'Aprano
asit wrote: > My program contains some sys.exit(1) and when its executed an > exception known as SystemExit is thrown. > > I tried to handle bu using following code snippet > > if __name__ == "__main__": > try: > main() #main contains sys.exit(1) > except KeyboardInterrupt: >

Re: Handle SystemExit exception

2009-02-01 Thread Gabriel Genellina
En Sun, 01 Feb 2009 07:27:26 -0200, asit escribió: My program contains some sys.exit(1) and when its executed an exception known as SystemExit is thrown. This is normal behaviour - but you should not "see" the SystemExit. Do you mean that a stack trace appears in the console? I tried to