python: Use raw-strings expressions
authorCarsten Schoenert <c.schoenert@t-online.de>
Thu, 18 Jul 2024 14:50:22 +0000 (16:50 +0200)
committerCarsten Schoenert <c.schoenert@t-online.de>
Thu, 26 Dec 2024 09:30:34 +0000 (11:30 +0200)
Python 3.12 is now more pedantic about the used string regexp syntax in
re.* functions.

Gbp-Pq: Topic fixes
Gbp-Pq: Name python-Use-raw-strings-expressions.patch

eeschema/python_scripts/kicad_netlist_reader.py

index 1a4146eb3cace1356d781d084ccd6a2506dc3b9b..5d105d67b275167bb11c926f5a442e219a4bd85b 100644 (file)
@@ -745,7 +745,7 @@ class netlist():
         # the normal sort would place 100 before 99 since it only would look at the first digit.
         def sortKey( str ):
             return [ int(t) if t.isdigit() else t.lower()
-                    for t in re.split( '(\d+)', str ) ]
+                    for t in re.split( r'(\d+)', str ) ]
 
         ret.sort(key=lambda g: sortKey(g.getRef()))
 
@@ -791,7 +791,7 @@ class netlist():
         # the normal sort would place 100 before 99 since it only would look at the first digit.
         def sortKey( str ):
             return [ int(t) if t.isdigit() else t.lower()
-                    for t in re.split( '(\d+)', str ) ]
+                    for t in re.split( r'(\d+)', str ) ]
 
         for g in groups:
             #g = sorted(g, key=lambda g: sortKey(g.getRef()))