1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

devlib.utils: Fix escape sequences

Fix invalid escape sequence, mostly in regex that were not r-strings.
This commit is contained in:
douglas-raillard-arm 2020-11-16 15:50:48 +00:00 committed by Marc Bonnici
parent 81db8200e2
commit d300b9e57f
4 changed files with 4 additions and 4 deletions

View File

@ -649,7 +649,7 @@ def grant_app_permissions(target, package):
dumpsys = target.execute('dumpsys package {}'.format(package))
permissions = re.search(
'requested permissions:\s*(?P<permissions>(android.permission.+\s*)+)', dumpsys
r'requested permissions:\s*(?P<permissions>(android.permission.+\s*)+)', dumpsys
)
if permissions is None:
return

View File

@ -18,7 +18,7 @@ import logging
from devlib.utils.types import numeric
GEM5STATS_FIELD_REGEX = re.compile("^(?P<key>[^- ]\S*) +(?P<value>[^#]+).+$")
GEM5STATS_FIELD_REGEX = re.compile(r"^(?P<key>[^- ]\S*) +(?P<value>[^#]+).+$")
GEM5STATS_DUMP_HEAD = '---------- Begin Simulation Statistics ----------'
GEM5STATS_DUMP_TAIL = '---------- End Simulation Statistics ----------'
GEM5STATS_ROI_NUMBER = 8

View File

@ -495,7 +495,7 @@ def escape_spaces(text):
.. note:: :func:`pipes.quote` should be favored where possible.
"""
return text.replace(' ', '\ ')
return text.replace(' ', '\\ ')
def getch(count=1):

View File

@ -1396,7 +1396,7 @@ class Gem5Connection(TelnetConnection):
both of these.
"""
gem5_logger.debug("Sending Sync")
self.conn.send("echo \*\*sync\*\*\n")
self.conn.send("echo \\*\\*sync\\*\\*\n")
self.conn.expect(r"\*\*sync\*\*", timeout=self.default_timeout)
self.conn.expect([self.conn.UNIQUE_PROMPT, self.conn.PROMPT], timeout=self.default_timeout)
self.conn.expect([self.conn.UNIQUE_PROMPT, self.conn.PROMPT], timeout=self.default_timeout)