mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
test/py: Use raw strings more to avoid deprecation warnings
We have two further uses of raw string usage in the test/py codebase that are used under CI. The first of which is under the bind test and is a direct update. The second of which is to strip VT100 codes from the match buffer. While switching this to a raw string is also a direct update, the comment it notes that problems were encountered on Ubuntu 14.04 (and whatever Python 2 version that was) that required slight tweaks to the regex. Replace that now that we're saying Python 3.5 is the minimum. Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com> Tested-by: Simon Glass <sjg@chromium.org> [on sandbox] Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
085b8978b9
commit
15579631bc
2 changed files with 3 additions and 6 deletions
|
@ -42,10 +42,7 @@ class Spawn(object):
|
|||
self.after = ''
|
||||
self.timeout = None
|
||||
# http://stackoverflow.com/questions/7857352/python-regex-to-match-vt100-escape-sequences
|
||||
# Note that re.I doesn't seem to work with this regex (or perhaps the
|
||||
# version of Python in Ubuntu 14.04), hence the inclusion of a-z inside
|
||||
# [] instead.
|
||||
self.re_vt100 = re.compile('(\x1b\[|\x9b)[^@-_a-z]*[@-_a-z]|\x1b[@-_a-z]')
|
||||
self.re_vt100 = re.compile(r'(\x1b\[|\x9b)[^@-_]*[@-_]|\x1b[@-_]', re.I)
|
||||
|
||||
(self.pid, self.fd) = pty.fork()
|
||||
if self.pid == 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue