diff --git a/avocado/utils/filelock.py b/avocado/utils/filelock.py index ac46084556eacd13c0e1dcad64c0201d57456fc2..b996f6e0807ab9512382faef9dc6e551c1cf8547 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 diff --git a/selftests/unit/test_safeloader.py b/selftests/unit/test_safeloader.py index ea9f7d96ab32ad5f62becd0e6da55535e4498bd6..5c07be6b0d99058e077e1716b0e9f5049b4bc12d 100644 --- a/selftests/unit/test_safeloader.py +++ b/selftests/unit/test_safeloader.py @@ -130,9 +130,9 @@ class DocstringDirectives(unittest.TestCase): Tests the regular expressions that deal with docstring directives """ for directive in self.VALID_DIRECTIVES: - self.assertRegexpMatches(directive, safeloader.DOCSTRING_DIRECTIVE_RE) + self.assertTrue(safeloader.DOCSTRING_DIRECTIVE_RE.match(directive)) for directive in self.INVALID_DIRECTIVES: - self.assertNotRegexpMatches(directive, safeloader.DOCSTRING_DIRECTIVE_RE) + self.assertFalse(safeloader.DOCSTRING_DIRECTIVE_RE.match(directive)) class UnlimitedDiff(unittest.TestCase):