File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 2323# This will get replaced with a git SHA1 when you do a git archive
2424__revision__ = '$Format:%H$'
2525
26- from PyQt4 .QtCore import QPyNullVariant
27- from types import MethodType
26+ try :
27+ # Add a __nonzero__ method onto QPyNullVariant so we can check for null values easier.
28+ # >>> value = QPyNullVariant("int")
29+ # >>> if value:
30+ # >>> print "Not a null value"
31+ from types import MethodType
32+ from PyQt4 .QtCore import QPyNullVariant
33+ def __nonzero__ (self ):
34+ return False
2835
29- # Add a __nonzero__ method onto QPyNullVariant so we can check for null values easier.
30- # >>> value = QPyNullVariant("int")
31- # >>> if value:
32- # >>> print "Not a null value"
33- def __nonzero__ (self ):
34- return False
36+ QPyNullVariant .__nonzero__ = MethodType (__nonzero__ , None , QPyNullVariant )
37+ except ImportError :
38+ pass
3539
36- QPyNullVariant .__nonzero__ = MethodType (__nonzero__ , None , QPyNullVariant )
You can’t perform that action at this time.
0 commit comments