Adapted samples for py3 support

This commit is contained in:
hakril
2020-05-11 09:00:57 +02:00
parent 176066d917
commit 654280c8a5
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ for cls in devmgr.classes[:3]:
print("Finding device class 'System'")
# Allow devmgr.classes["name"] ?
system_cls = [cls for cls in devmgr.classes if cls.name == "System"][0]
system_cls = [cls for cls in devmgr.classes if cls.name == b"System"][0]
print(" * {0}".format(system_cls))
print(" Enumerating some devices of 'System'")
devices = system_cls.devices.all()
+1 -1
View File
@@ -7,7 +7,7 @@ devmgr = windows.system.device_manager
def class_generator(filter=None):
for cls in devmgr.classes:
if filter and cls.name != filter:
if filter and cls.name != filter.encode():
continue
yield cls