Selaa lähdekoodia

Combine except clauses that do the same thing

Mike Naberezny 11 vuotta sitten
vanhempi
commit
e58e466754
1 muutettua tiedostoa jossa 2 lisäystä ja 4 poistoa
  1. 2 4
      supervisor/datatypes.py

+ 2 - 4
supervisor/datatypes.py

@@ -32,10 +32,8 @@ def process_or_group_name(name):
 def integer(value):
     try:
         return int(value)
-    except ValueError:
-        return long(value) # why does this help? (CM)
-    except OverflowError:
-        return long(value)
+    except (ValueError, OverflowError):
+        return long(value) # why does this help ValueError? (CM)
 
 TRUTHY_STRINGS = ('yes', 'true', 'on', '1')
 FALSY_STRINGS  = ('no', 'false', 'off', '0')