Revision 691744c4 lib/cli.py
b/lib/cli.py | ||
---|---|---|
827 | 827 |
if unitfields.Matches(fields[idx]): |
828 | 828 |
try: |
829 | 829 |
val = int(val) |
830 |
except ValueError:
|
|
830 |
except (TypeError, ValueError):
|
|
831 | 831 |
pass |
832 | 832 |
else: |
833 | 833 |
val = row[idx] = utils.FormatUnit(val, units) |
... | ... | |
902 | 902 |
if value[-1] not in suffix_map: |
903 | 903 |
try: |
904 | 904 |
value = int(value) |
905 |
except ValueError:
|
|
905 |
except (TypeError, ValueError):
|
|
906 | 906 |
raise errors.OpPrereqError("Invalid time specification '%s'" % value) |
907 | 907 |
else: |
908 | 908 |
multiplier = suffix_map[value[-1]] |
... | ... | |
912 | 912 |
" suffix passed)") |
913 | 913 |
try: |
914 | 914 |
value = int(value) * multiplier |
915 |
except ValueError:
|
|
915 |
except (TypeError, ValueError):
|
|
916 | 916 |
raise errors.OpPrereqError("Invalid time specification '%s'" % value) |
917 | 917 |
return value |
918 | 918 |
|
Also available in: Unified diff