Skip to content

Commit

Permalink
socket shutdown moved to try rather than finally
Browse files Browse the repository at this point in the history
  • Loading branch information
nubela committed Feb 5, 2013
1 parent 76d75d2 commit 5f8945a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ner/utils.py
Expand Up @@ -13,9 +13,10 @@ def tcpip4_socket(host, port):
try:
s.connect((host, port))
yield s
finally:
s.shutdown(socket.SHUT_RDWR)
s.close()
except:
pass

@contextmanager
def http_connection(host, port):
Expand Down

0 comments on commit 5f8945a

Please sign in to comment.