# HG changeset patch # User Paul Boddie # Date 1444514130 -7200 # Node ID 880ad0960d07d4aa1d3f9e8693a7036875c72a44 # Parent 5e99d4b0e15f2167ea1884f0b136fc9b479f8cfc# Parent 065abc8520c57074949f63f6070bea4cc56a3259 Fixed the get_float function. diff -r 5e99d4b0e15f -r 880ad0960d07 optimiser.py --- a/optimiser.py Sat Oct 10 23:54:18 2015 +0200 +++ b/optimiser.py Sat Oct 10 23:55:30 2015 +0200 @@ -75,9 +75,9 @@ def get_float(options, flag): try: i = options.index(flag) - if i+1 < len(options) and options[i+1].isdigit(): + try: return float(options[i+1]) - else: + except (IndexError, ValueError): return 1.0 except ValueError: return 0.0