> in other words you are tuple-unpacking the exception. Since it is not a
> tuple, but a single value, you get an error. Try this:
>        except socket.error, e:
>           if self.s:
>              self.s.close()
>           print "Could not open socket: " + e.message

Thanks a lot! I had to make a minor change to get it to work though.
'e' is a list with variable number of elements (depends on the
exception). Replacing e.message with str(e) does the trick.

Thanks,
Vinay
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to