Revision 691744c4
ID | 691744c43f814ac6318fdfd5c1b156831b293a3f |
Ensure all int/float conversions are handled right
int()/float() can raise either ValueError (in case of int("a")), or
TypeError (in case of int(None)). We had many bugs over time due to
this, and a recent one was just diagnosed, so we go over the codebase
and replace all 'except ValueError' with 'except (TypeError,
ValueError)' that protect such conversions (there were no 'except
TypeError' cases that needed a ValueError added).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Files
- added
- modified
- copied
- renamed
- deleted
- lib
- backend.py (diff)
- bdev.py (diff)
- cli.py (diff)
- cmdlib.py (diff)
- http
- __init__.py (diff)
- client.py (diff)
- hypervisor
- objects.py (diff)
- utils.py (diff)
- scripts