You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-numexpr/SOURCES/0007-Use-r-to-avoid-warning...

32 lines
1.2 KiB

From 89696f397f167958a6dfc8ccb1f0d796fb4307a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 16 Aug 2023 17:11:28 +0200
Subject: [PATCH 7/7] Use r"" to avoid warning about unknown escapes
---
numexpr/cpuinfo.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/numexpr/cpuinfo.py b/numexpr/cpuinfo.py
index 4f934b7ba2..4a57d3cb03 100755
--- a/numexpr/cpuinfo.py
+++ b/numexpr/cpuinfo.py
@@ -105,7 +105,7 @@ class CPUInfoBase(object):
def __get_nbits(self):
abits = platform.architecture()[0]
- nbits = re.compile('(\d+)bit').search(abits).group(1)
+ nbits = re.compile(r'(\d+)bit').search(abits).group(1)
return nbits
def _is_32bit(self):
@@ -658,7 +658,7 @@ class Win32CPUInfo(CPUInfoBase):
#XXX: Bad style to use so long `try:...except:...`. Fix it!
prgx = re.compile(r"family\s+(?P<FML>\d+)\s+model\s+(?P<MDL>\d+)"
- "\s+stepping\s+(?P<STP>\d+)", re.IGNORECASE)
+ r"\s+stepping\s+(?P<STP>\d+)", re.IGNORECASE)
chnd = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, self.pkey)
pnum = 0
while 1: