From 794741fa1fa597fd749862dbd37ba678055dcceb Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 3 Jul 2014 13:10:47 +0200 Subject: [PATCH] Fix conversion of string bools to bools --- server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index a57b4fd..50dd134 100755 --- a/server.py +++ b/server.py @@ -253,10 +253,10 @@ def checkRequest(server): if data[0]: return False else: continue #### Compatibility code #### - # Accept anything in boolean fields but convert it to a - # boolean, because old servers send some booleans as strings. - if data[1] == "bool": - server[name] = True if server[name] else False + # Accept strings in boolean fields but convert it to a + # boolean, because old servers sent some booleans as strings. + if data[1] == "bool" and type(server[name]).__name__ == "str": + server[name] = True if server[name].lower() in ["true", "1"] else False continue # clients_max was sent as a string instead of an integer if name == "clients_max" and type(server[name]).__name__ == "str":