Skip to content

Commit

Permalink
Properly report QgsDefaultValue.__bool__ in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent f2d512a commit 900be9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ def _geometryNonZero(self):
return not self.isEmpty()


def _isValid(self):
return self.isValid()

QgsGeometry.__nonzero__ = _geometryNonZero
QgsGeometry.__bool__ = _geometryNonZero

QgsDefaultValue.__bool__ = _isValid


def register_function(function, arg_count, group, usesgeometry=False,
referenced_columns=[QgsFeatureRequest.ALL_ATTRIBUTES], **kwargs):
Expand Down

0 comments on commit 900be9f

Please sign in to comment.