From 6804537a46de531eb7e728b835b9a546a96ea325 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Fri, 19 Jan 2018 07:25:48 -0500 Subject: [PATCH] avocado/utils/filelock.py: use alternative way to get process pid in bytes PEP461 is only available on Python 3.5. Our CI (Travis) is set to run on Python 3.4, and there's no reason not to be compatible with those older Python versions IMO. Let's then use a syntax that will produce the same content, but will work on all Python 3.x versions. Reference: https://docs.python.org/3.5/whatsnew/3.5.html Signed-off-by: Cleber Rosa --- avocado/utils/filelock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avocado/utils/filelock.py b/avocado/utils/filelock.py index ac460845..b996f6e0 100644 --- a/avocado/utils/filelock.py +++ b/avocado/utils/filelock.py @@ -42,7 +42,7 @@ class FileLock(object): def __init__(self, filename, timeout=0): self.filename = '%s.lock' % filename - self.pid = b'%r' % os.getpid() + self.pid = '{0}'.format(os.getpid()).encode() self.locked = False self.timeout = timeout -- GitLab