From: Christian Heller Date: Tue, 24 Feb 2015 02:07:24 +0000 (+0100) Subject: Server/py: Fix buggy ValueError handling. X-Git-Tag: tce~479 X-Git-Url: https://plomlompom.com/repos/feed.xml?a=commitdiff_plain;h=9cf1709315a5935ccbb329066189d09e227bfde8;p=plomrogue Server/py: Fix buggy ValueError handling. --- diff --git a/plomrogue-server.py b/plomrogue-server.py index d5745ed..cae9d90 100755 --- a/plomrogue-server.py +++ b/plomrogue-server.py @@ -250,10 +250,10 @@ def command_quit(): def command_turn(turn_string): """Set turn to what's described in turn_string.""" + min = 0 + max = 65535 try: turn = int(turn_string) - min = 0 - max = 65535 if turn < min or turn > max: raise ValueError world_db["TURN"] = turn @@ -264,10 +264,10 @@ def command_turn(turn_string): def command_makeworld(seed_string): # Mere dummy so far. + min = 0 + max = 4294967295 try: seed = int(seed_string) - min = 0 - max = 4294967295 if seed < min or seed > max: raise ValueError world_db["SEED_RANDOMNESS"] = seed