mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	devlib.utils: Fix escape sequences
Fix invalid escape sequence, mostly in regex that were not r-strings.
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							81db8200e2
						
					
				
				
					commit
					d300b9e57f
				
			@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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):
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user