From 6025f7364c6314d71326db6f956c81a4afccd50b 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. Signed-off-by: James McCoy --- 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 0e657e9f0..470949f25 100644 --- a/src/utils/net.py +++ b/src/utils/net.py @@ -73,7 +73,7 @@ def isIPV4(s): 0 """ try: - return bool(socket.inet_aton(s)) + return bool(socket.inet_aton(str(s))) except socket.error: return False