Skip to content

Commit

Permalink
Use typing.Sequence instead of abc.Sequence
Browse files Browse the repository at this point in the history
This fixes typing in Python 3.7
  • Loading branch information
gadomski committed Sep 14, 2021
1 parent e9923f0 commit 7d74398
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/stactools/core/projection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from collections import abc
from copy import deepcopy
from typing import Any, List, Optional, Union, Dict
from typing import Any, List, Optional, Union, Dict, Sequence

import pyproj
import rasterio.crs
Expand Down Expand Up @@ -49,11 +48,11 @@ def reproject_geom(src_crs: Union[pyproj.CRS, rasterio.crs.CRS, str],
always_xy=True)
result = deepcopy(geom)

def fn(coords: abc.Sequence[Any]) -> abc.Sequence[Any]:
def fn(coords: Sequence[Any]) -> Sequence[Any]:
coords = list(coords)
for i in range(0, len(coords)):
coord = coords[i]
if isinstance(coord[0], abc.Sequence):
if isinstance(coord[0], Sequence):
coords[i] = fn(coord)
else:
x, y = coord
Expand Down

0 comments on commit 7d74398

Please sign in to comment.