diff --git a/python/PyQt6/core/__init__.py.in b/python/PyQt6/core/__init__.py.in index 7adb81759c9e..5f9dc32bba3d 100644 --- a/python/PyQt6/core/__init__.py.in +++ b/python/PyQt6/core/__init__.py.in @@ -633,8 +633,9 @@ except ModuleNotFoundError: try: import shapely as _shapely + import shapely.geometry as _sg - def _geometry_as_shapely(self) -> _shapely.geometry.base.BaseGeometry: + def _geometry_as_shapely(self) -> _sg.base.BaseGeometry: wkb_qbytearray = self.asWkb() # Get the geometry in WKB format (QByteArray) shapely_geom = _shapely.from_wkb(wkb_qbytearray.data()) diff --git a/python/core/__init__.py.in b/python/core/__init__.py.in index 0db883630ed8..3e3727db8da2 100644 --- a/python/core/__init__.py.in +++ b/python/core/__init__.py.in @@ -643,8 +643,9 @@ except ModuleNotFoundError: try: import shapely as _shapely + import shapely.geometry as _sg - def _geometry_as_shapely(self) -> _shapely.geometry.base.BaseGeometry: + def _geometry_as_shapely(self) -> _sg.base.BaseGeometry: wkb_qbytearray = self.asWkb() # Get the geometry in WKB format (QByteArray) shapely_geom = _shapely.from_wkb(wkb_qbytearray.data())