提交 6804537a 编写于 作者: C Cleber Rosa

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.htmlSigned-off-by: NCleber Rosa <crosa@redhat.com>
上级 70d525f1
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册