From 6358dbc27205e03e749eb66c87e5c92c4b3beb11 Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Wed, 9 Jun 2010 14:27:26 +0100 Subject: [PATCH] jstore._ReadNumericFile: use utils.ReadFile Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- lib/jstore.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/jstore.py b/lib/jstore.py index cc1bb4cf0..f61a79ceb 100644 --- a/lib/jstore.py +++ b/lib/jstore.py @@ -36,17 +36,12 @@ def _ReadNumericFile(file_name): """ try: - fd = open(file_name, "r") - except IOError, err: + return int(utils.ReadFile(file_name)) + except EnvironmentError, err: if err.errno in (errno.ENOENT, ): return None raise - try: - return int(fd.read(128)) - finally: - fd.close() - def ReadSerial(): """Read the serial file. -- GitLab