mirror of
https://github.com/django/django.git
synced 2025-06-07 20:49:11 +00:00
[2.1.x] Fixed 'invalid escape sequence' warning in GEOSGeometryBase.from_ewkt().
Backport of 7a266e25be1b641111ab5889f9808ff6d258d27f from master.
This commit is contained in:
parent
69e2d173e5
commit
bdc71f526f
@ -113,7 +113,7 @@ class GEOSGeometryBase(GEOSBase):
|
|||||||
parts = ewkt.split(b';', 1)
|
parts = ewkt.split(b';', 1)
|
||||||
if len(parts) == 2:
|
if len(parts) == 2:
|
||||||
srid_part, wkt = parts
|
srid_part, wkt = parts
|
||||||
match = re.match(b'SRID=(?P<srid>\-?\d+)', srid_part)
|
match = re.match(br'SRID=(?P<srid>\-?\d+)', srid_part)
|
||||||
if not match:
|
if not match:
|
||||||
raise ValueError('EWKT has invalid SRID part.')
|
raise ValueError('EWKT has invalid SRID part.')
|
||||||
srid = int(match.group('srid'))
|
srid = int(match.group('srid'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user