summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2017-01-29 01:41:44 +0000
committerJavier Jardón <jjardon@gnome.org>2017-01-29 02:17:21 +0000
commite790571ae605a1049af72df3d40334d17236ffbf (patch)
tree0259a32e38f428f5338b1a434d971dd27cd233dc
parentabd0dbbacd9cdc0b9d8047aa350d599e0b06ab8e (diff)
downloadybd-e790571ae605a1049af72df3d40334d17236ffbf.tar.gz
Do not use 'l' as a variable
" Never use the characters 'l', 'O', or 'I' as variable names. In some fonts, these characters are indistinguishable from the numerals one and zero. When tempted to use 'l', use 'L' instead. " https://www.python.org/dev/peps/pep-0008/#names-to-avoid
-rw-r--r--ybd/app.py4
-rw-r--r--ybd/assembly.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/ybd/app.py b/ybd/app.py
index 51dc2d9..a748cc9 100644
--- a/ybd/app.py
+++ b/ybd/app.py
@@ -46,9 +46,9 @@ class RetryException(Exception):
if config.get('last-retry-time'):
wait = datetime.datetime.now() - config.get('last-retry-time')
if wait.seconds < 1:
- with open(lockfile(dn), 'r') as l:
+ with open(lockfile(dn), 'r') as L:
call(['flock', '--shared', '--timeout',
- config.get('timeout', '60'), str(l.fileno())])
+ config.get('timeout', '60'), str(L.fileno())])
log(dn, 'Finished wait loop', verbose=True)
config['last-retry-time'] = datetime.datetime.now()
config['last-retry-dn'] = dn
diff --git a/ybd/assembly.py b/ybd/assembly.py
index 34f278a..0b2e1c9 100644
--- a/ybd/assembly.py
+++ b/ybd/assembly.py
@@ -201,9 +201,9 @@ def shuffle(contents):
@contextlib.contextmanager
def claim(dn):
- with open(lockfile(dn), 'a') as l:
+ with open(lockfile(dn), 'a') as L:
try:
- fcntl.flock(l, fcntl.LOCK_EX | fcntl.LOCK_NB)
+ fcntl.flock(L, fcntl.LOCK_EX | fcntl.LOCK_NB)
except Exception as e:
if e.errno in (errno.EACCES, errno.EAGAIN):
# flock() will report EACCESS or EAGAIN when the lock fails.