mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Fix VARIANT interpretation of VT_BOOL
This commit is contained in:
@@ -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
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user