From 63b9b1864301e3a9e4c4dbee844c23a929fc5fda Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Fri, 26 Jun 2009 15:58:38 +0100 Subject: [PATCH] _OSOndiskAPIVersion: save a loop The api_versions list is first stripped and then converted to integer. Combining the two operations. Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/backend.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/backend.py b/lib/backend.py index b19b4012e..01fd28dc2 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -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)) -- GitLab