mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
[py3] Use __bool__ instead of __nonzero__
This commit is contained in:
parent
7e113840cb
commit
ced7c27dcf
@ -8,11 +8,8 @@ _QVariant__ne__ = QVariant.__ne__
|
||||
_QVariant__hash__ = QVariant.__hash__
|
||||
|
||||
|
||||
def __nonzero__(self):
|
||||
if self.isNull():
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
def __bool__(self):
|
||||
return not self.isNull()
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
@ -42,7 +39,7 @@ def __hash__(self):
|
||||
else:
|
||||
return _QVariant__hash__(self)
|
||||
|
||||
QVariant.__nonzero__ = __nonzero__
|
||||
QVariant.__bool__ = __bool__
|
||||
QVariant.__repr__ = __repr__
|
||||
QVariant.__eq__ = __eq__
|
||||
QVariant.__ne__ = __ne__
|
||||
|
Loading…
x
Reference in New Issue
Block a user