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