mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
python: Use raw-strings expressions
Python 3.12 is now more pedantic about the used string regexp syntax in re.* functions. Signed-off-by: Carsten Schoenert <c.schoenert@t-online.de> Signed-off-by: Adrien Ricciardi <adrien.ricciardi@hotmail.fr> [Adrien Ricciardi: This patch comes from Debian: https://sources.debian.org/src/kicad/9.0.3+dfsg-1/debian/patches/fixes/python-Use-raw-strings-expressions.patch]
This commit is contained in:
parent
58c9893a3f
commit
9fcee70827
@ -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()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user