
April 2nd, 2004, 10:32 AM
|
|
Contributing User
|
|
Join Date: Mar 2003
Posts: 81
Time spent in forums: 4 m 41 sec
Reputation Power: 11
|
|
|
sys.exit problem
Ok so here is my problem I have this code segment of code
if opera =="/":
if (temp1 == "0"):
print "Error going to bail"
self.error()
return (int(temp2) // int(temp1))
this works fine, when temp1=="0" it goes to the error function however
def error(self):
print "error"
sys.exit(-1)
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?
|