compare with equality not identity (issue #16172)

Patch from Serhiy Storchaka.
This commit is contained in:
Benjamin Peterson 2012-10-09 11:14:59 -04:00
parent 14fb44e1ba
commit a511935151
1 changed files with 2 additions and 6 deletions

View File

@ -16,16 +16,12 @@ def has_sound(sound):
try:
# Ask the mixer API for the number of devices it knows about.
# When there are no devices, PlaySound will fail.
if ctypes.windll.winmm.mixerGetNumDevs() is 0:
if ctypes.windll.winmm.mixerGetNumDevs() == 0:
return False
key = winreg.OpenKeyEx(winreg.HKEY_CURRENT_USER,
"AppEvents\Schemes\Apps\.Default\{0}\.Default".format(sound))
value = winreg.EnumValue(key, 0)[1]
if value is not "":
return True
else:
return False
return winreg.EnumValue(key, 0)[1] != ""
except WindowsError:
return False