From f5950d10c1d0107c51d98a7cdfe04ccbc321c86e Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 9 Sep 2013 16:38:43 +0200 Subject: [PATCH] [entropy.const] drop access() usage --- lib/entropy/const.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/entropy/const.py b/lib/entropy/const.py index 690b81ddc..093b4a2e1 100644 --- a/lib/entropy/const.py +++ b/lib/entropy/const.py @@ -747,12 +747,14 @@ def const_read_entropy_release(): if not os.path.isfile(revision_file): revision_file = os.path.join(etpConst['installdir'], 'lib/entropy/revision') - if os.path.isfile(revision_file) and \ - os.access(revision_file, os.R_OK): + try: with codecs.open(revision_file, "r", encoding=ENCODING) as rev_f: myrev = rev_f.readline().strip() etpConst['entropyversion'] = myrev + except (OSError, IOError) as err: + if err.errno != errno.ENOENT: + raise def const_pid_exists(pid): """