Re: 2.6 and sys.exit()

2009-11-12 Thread hetchkay
On Nov 13, 10:28 am, hetchkay wrote: > On Nov 13, 9:50 am, John Yeung wrote: > > > > > On Nov 12, 11:22 pm, r wrote: > > > > On Nov 12, 10:07 pm, hetchkay wrote: > > > > I have the following in exit.py: > > > > import sys > > > > sys.exit(0) > > > > > I now try 'python -i exit.py': > > > > > In

Re: 2.6 and sys.exit()

2009-11-12 Thread hetchkay
On Nov 13, 9:50 am, John Yeung wrote: > On Nov 12, 11:22 pm, r wrote: > > > > > On Nov 12, 10:07 pm, hetchkay wrote: > > > I have the following in exit.py: > > > import sys > > > sys.exit(0) > > > > I now try 'python -i exit.py': > > > > In 2.5, the script exits as I would expect. > > > > In 2.6

Re: 2.6 and sys.exit()

2009-11-12 Thread Ned Deily
In article <008aa7ef-b945-4f70-b5e4-def66546e...@2g2000prl.googlegroups.com>, hetchkay wrote: > I have the following in exit.py: > import sys > sys.exit(0) > > I now try 'python -i exit.py': > > In 2.5, the script exits as I would expect. > > In 2.6, the following error is printed: > > Trace

Re: 2.6 and sys.exit()

2009-11-12 Thread John Yeung
On Nov 12, 11:32 pm, hetchkay wrote: > But I don't understand why the interpreter does not exit in 2.6 but > does exit in 2.5. Well, I do not need to understand that but I need to > know how to get the interpreter to exit in 2.6. Well, taken at face value, I would say the answer is to not use the

Re: 2.6 and sys.exit()

2009-11-12 Thread John Yeung
On Nov 12, 11:22 pm, r wrote: > On Nov 12, 10:07 pm, hetchkay wrote: > > I have the following in exit.py: > > import sys > > sys.exit(0) > > > I now try 'python -i exit.py': > > > In 2.5, the script exits as I would expect. > > > In 2.6, the following error is printed: > > > Traceback (most recen

Re: 2.6 and sys.exit()

2009-11-12 Thread hetchkay
Hello, Thanks for your help. I know what SystemExit is. In 2.5 as well SystemExit is raised when sys.exit() is called. For example: try: import sys sys.exit(0) except SystemExit: print "system exit raised" raise But I don't understand why the interpreter does not exit in 2.6 but does exi

Re: 2.6 and sys.exit()

2009-11-12 Thread r
PS: Python even answers questions: >>> import sys >>> help(sys.exit) Help on built-in function exit in module sys: exit(...) exit([status]) Exit the interpreter by raising SystemExit(status). If the status is omitted or None, it defaults to zero (i.e., success). If the status is

Re: 2.6 and sys.exit()

2009-11-12 Thread r
On Nov 12, 10:07 pm, hetchkay wrote: > Hello, > > I have the following in exit.py: > import sys > sys.exit(0) > > I now try 'python -i exit.py': > > In 2.5, the script exits as I would expect. > > In 2.6, the following error is printed: > > Traceback (most recent call last): >   File "exit.py", li

2.6 and sys.exit()

2009-11-12 Thread hetchkay
Hello, I have the following in exit.py: import sys sys.exit(0) I now try 'python -i exit.py': In 2.5, the script exits as I would expect. In 2.6, the following error is printed: Traceback (most recent call last): File "exit.py", line 2, in sys.exit(0) SystemExit: 0 >>> I couldn't find

Python 2.6 and sys.exit()

2009-11-12 Thread H Krishnan
Hello, I have the following in exit.py: import sys sys.exit(0) I now try 'python -i exit.py': In 2.5, the script exits as I would expect. In 2.6, the following error is printed: Traceback (most recent call last): File "exit.py", line 2, in sys.exit(0) SystemExit: 0 >>> I couldn't find