Commit 63b9b186 authored by Guido Trotter's avatar Guido Trotter
Browse files

_OSOndiskAPIVersion: save a loop



The api_versions list is first stripped and then converted to integer.
Combining the two operations.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 3374afa9
......@@ -1495,9 +1495,8 @@ def _OSOndiskAPIVersion(name, os_dir):
return False, ("Error while reading the API version file at %s: %s" %
(api_file, _ErrnoOrStr(err)))
api_versions = [version.strip() for version in api_versions]
try:
api_versions = [int(version) for version in api_versions]
api_versions = [int(version.strip()) for version in api_versions]
except (TypeError, ValueError), err:
return False, ("API version(s) can't be converted to integer: %s" %
str(err))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment