Fix VARIANT interpretation of VT_BOOL

This commit is contained in:
Clement Rouault
2016-12-06 16:20:02 +01:00
parent 11bdbd8873
commit e58fb73f3b
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -2,6 +2,7 @@ TODO:
- Documentation
- Better WMI interface
- Bug in VARIANT_TYPE == BOOL (see Win32_OperatingSystem->Debug)
- DBG
- Verif multiple bp at same place..
+2 -2
View File
@@ -88,7 +88,7 @@ class ImprovedVariant(VARIANT):
@property
def aslong(self):
if not self.vt in [VT_I4, VT_BOOL]:
if not self.vt in [VT_I4]:
raise ValueError("aslong on non-long variant")
return self._VARIANT_NAME_3.lVal
@@ -96,7 +96,7 @@ class ImprovedVariant(VARIANT):
def asbool(self):
if not self.vt in [VT_BOOL]:
raise ValueError("get_bstr on non-bool variant")
return bool(self.aslong)
return bool(self._VARIANT_NAME_3.boolVal)
@property
def asdispatch(self):