Description: Use raw strings for regular expressions with backslashes Prefix the CPU and memory specification regular expressions with r so Python no longer emits SyntaxWarning for invalid string escape sequences. Author: Alexandre Detiste Forwarded: not-needed Bug-Debian: https://bugs.debian.org/1085531 Last-Update: 2025-03-15 --- a/cpuset/cset.py +++ b/cpuset/cset.py @@ -343,7 +343,7 @@ def cpuspec_check(cpuspec, usemax=True): """check format of cpuspec for validity""" log.debug("cpuspec_check(%s)", cpuspec) - mo = re.search("[^0-9,\-]", cpuspec) + mo = re.search(r"[^0-9,\-]", cpuspec) if mo: str = 'CPUSPEC "%s" contains invalid charaters: %s' % (cpuspec, mo.group()) log.debug(str) @@ -395,7 +395,7 @@ # information and check the memspec that way, currently we only do # a basic check log.debug("memspec_check(%s)", memspec) - mo = re.search("[^0-9,\-]", memspec) + mo = re.search(r"[^0-9,\-]", memspec) if mo: str = 'MEMSPEC "%s" contains invalid charaters: %s' % (memspec, mo.group()) log.debug(str)