Skip to content

Commit

Permalink
avoid using str.removeprefix (breaks python 3.8 compatibility)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelquast committed Feb 5, 2025
1 parent a23f43d commit 63870c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eomaps/_maps_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,12 @@ def crs_plot(self):
def _get_cartopy_crs(crs):
if isinstance(crs, str):
try:
crs = int(crs.upper().removeprefix("EPSG:"))
# TODO use crs=int(crs.upper().removeprefix("EPSG:")) when python>=3.9
# is required
crs = crs.upper()
if crs.startswith("EPSG:"):
crs = crs[5:]
crs = int(crs)
except ValueError:
raise ValueError(
f"The provided crs '{crs}' cannot be identified. "
Expand Down

0 comments on commit 63870c0

Please sign in to comment.