> Try catching 'socket.error'. It includes a tuple of the form (errocode, explanation) > sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > try: > val=sock.connect((url, port)) except socket.error, errortuple: print "socket error %s %s" % errortuple ..... > > except Exception: > print 'no luck connecting' > sock.close() > del sock > print val > sys.exit() > -- Doug Fort (dougfort at downright.com) Senior Meat Manager Downright Software LLC http://www.dougfort.net
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4