[Tutor] AssertionError issue

Akanksha Govil govilakanksha at yahoo.com
Mon Jul 24 15:04:29 CEST 2006


Hi,

I have a class in python which creates an ssh connection to a remote machine.

In a function of the class, I have put the code in try/except block.

try:
     ----------
     ----------
except AssertionError:
     print "Error Condition"

In this code, when error occurs, it raises the AssertionError but the destuctor isnt called itself.
As a result the ssh conenctions are not closed.

Whenever such errors occurs should I call a function closing the ssh connection?

What is the general way a python script exits on encountering an error?

Thanks
Akanksha

 		
---------------------------------
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060724/78e7c8fe/attachment.htm 


More information about the Tutor mailing list