# HG changeset patch # User Dejan Muhamedagic # Date 1312838871 -7200 # Node ID a09974a06cdf6a3d73c3cdfa6e4d89d41e2ca9f0 # Parent 29fd4f04c01f92e54026d9d6bb54d617d8b1fdcd Low: Shell: avoid DeprecationWarning for BaseException.message diff --git a/shell/modules/utils.py b/shell/modules/utils.py --- a/shell/modules/utils.py +++ b/shell/modules/utils.py @@ -257,9 +257,9 @@ def acquire_lock(dir): os.mkdir(os.path.join(dir,_LOCKDIR)) str2file("%d" % os.getpid(),os.path.join(dir,_LOCKDIR,_PIDF)) return True - except OSError, e: - if e.errno != os.errno.EEXIST: - common_err("%s" % e.message) + except OSError as (errno, strerror): + if errno != os.errno.EEXIST: + common_err(strerror) return False time.sleep(0.1) continue