Re: Handlign exceptions - NEWBIE !!

Adrian Phillips (tandem@freeze.oslo.dnmi.no)
Mon, 14 Mar 1994 11:44:38 +0000

Okay, so now I've tried:
s = socket (AF_INET, SOCK_STREAM)
while (1):
try:
s.bind (HOST, PORT)
except socket.error:
sys.stdout.write (socket.error[0] + socket.error[1])
continue
break

ie. removed the quotes and now I get:

Traceback (innermost last):
File "./t1.py", line 12
except socket.error:
TypeError: attribute-less object

Again, thnaks for any help,

Adrian

-- 
---------------------
 ========================================================================
=   	    	    	    	    	    	    	    	    	 =
= Adrian Phillips at The Norwegian Meteorological Institute   	    	 =
=    	    	    	    	    	    	    	    	    	 =
= BUT any thoughts in this are purely my own and have nothing to do with =
= this establishment, thankfully.   	    	    	    	    	 =
=   	    	    	    	    	    	    	    	    	 =
= Internet: daap@typhoon.oslo.dnmi.no  	    	    	    	    	 =
= Phone: 47 22 96 32 09	    	    	    	    	    	    	 =
= Fax: 47 22 96 30 50	    	    	    	    	    	    	 =
=   	    	    	    	    	    	    	    	     	 =
 ========================================================================