From 2c051bab9f11a3f79500fc51ac06fe9e194a24c4 Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Thu, 31 May 2012 22:53:21 -0400 Subject: [PATCH] core: force inet_aton argument to string to prevent occasional error on reconnect. it /should/ always be a string anyway, but sometimes things break with a TypeError that it is an int instead of the expected string and hangs up the bot. --- src/utils/net.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/net.py b/src/utils/net.py index 544371acd..289a2fe28 100644 --- a/src/utils/net.py +++ b/src/utils/net.py @@ -114,7 +114,7 @@ def isIPV4(s): 0 """ try: - return bool(socket.inet_aton(s)) + return bool(socket.inet_aton(str(s))) except socket.error: return False