We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14fb44e commit a511935Copy full SHA for a511935
1 file changed
Lib/test/test_winsound.py
@@ -16,16 +16,12 @@ def has_sound(sound):
16
try:
17
# Ask the mixer API for the number of devices it knows about.
18
# When there are no devices, PlaySound will fail.
19
- if ctypes.windll.winmm.mixerGetNumDevs() is 0:
+ if ctypes.windll.winmm.mixerGetNumDevs() == 0:
20
return False
21
22
key = winreg.OpenKeyEx(winreg.HKEY_CURRENT_USER,
23
"AppEvents\Schemes\Apps\.Default\{0}\.Default".format(sound))
24
- value = winreg.EnumValue(key, 0)[1]
25
- if value is not "":
26
- return True
27
- else:
28
- return False
+ return winreg.EnumValue(key, 0)[1] != ""
29
except WindowsError:
30
31
0 commit comments