From 59b6101b402278b3d7ca1224253969a93115978b Mon Sep 17 00:00:00 2001 From: Arnas Bradauskas Date: Mon, 16 Oct 2023 14:04:20 +0300 Subject: [PATCH] Fixed bare except --- traveltimepy/dto/responses/time_map_wkt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/traveltimepy/dto/responses/time_map_wkt.py b/traveltimepy/dto/responses/time_map_wkt.py index e8aeb58..0e13ccc 100644 --- a/traveltimepy/dto/responses/time_map_wkt.py +++ b/traveltimepy/dto/responses/time_map_wkt.py @@ -2,6 +2,7 @@ from pydantic import BaseModel, Field, validator from pydantic.generics import GenericModel from shapely import wkt +from shapely.errors import WKTReadingError Props = TypeVar("Props", bound=Union[Dict[str, Any], BaseModel]) @@ -14,7 +15,7 @@ def validate_wkt(cls, value: str) -> str: try: wkt.loads(value) return value - except: + except WKTReadingError: raise ValueError("Invalid WKT string")