Py2 compatibility

This commit is contained in:
Andres Vazquez 2022-09-13 17:02:01 -03:00
parent 9bc5b4f000
commit ca7a054a39
1 changed files with 2 additions and 2 deletions

View File

@ -227,13 +227,13 @@ class SpatialQuery(SpatialQueryMixin, p.SingletonPlugin):
try:
geometry = json.loads(geom_from_metadata)
except (AttributeError, ValueError) as e:
log.error(f'Geometry not valid JSON {e}, not indexing :: {geom_from_metadata[:100]}')
log.error('Geometry not valid JSON {}, not indexing :: {}'.format(e, geom_from_metadata[:100]))
return pkg_dict
try:
shape = shapely.geometry.shape(geometry)
except GeometryTypeError as e:
log.error(f'{e}, not indexing :: {geom_from_metadata[:100]}')
log.error('{}, not indexing :: {}'.format(e, geom_from_metadata[:100]))
return pkg_dict
if search_backend == 'solr':