Skip to content

Commit

Permalink
Fix exception with older shapely versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 7, 2024
1 parent 96855dc commit ba52899
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python/PyQt6/core/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
3 changes: 2 additions & 1 deletion python/core/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit ba52899

Please sign in to comment.