April 2nd, 2004, 10:32 AM
Ok so here is my problem I have this code segment of code
if opera =="/":
if (temp1 == "0"):
print "Error going to bail"
return (int(temp2) // int(temp1))
this works fine, when temp1=="0" it goes to the error function however
also appears to be working, it prints out error, but then for whatever reason it continues to execute I get errors from code after it should have exited. Anyone have ideas why? I do have some of this code in a recursive function, does sys.exit not work with recurrsion?
April 2nd, 2004, 11:32 AM
Any finally statements in your program?
From the manual re: sys.exit() :
"is implemented by raising the SystemExit exception, so cleanup actions specified by finally clauses of try statements are honored, and it is possible to intercept the exit attempt at an outer level. "
Also if you have used atexit (see the manual) - the exit process can be modified.