diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-10-09 15:14:59 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-10-09 15:14:59 (GMT) |
commit | a5119351519926971240f61d0c23a5fc5d00743e (patch) | |
tree | 201e707b8a716851633cb7fba92558267c4e6d28 /Lib | |
parent | 14fb44e1bab9db128770f1d91d244916a669e7c3 (diff) | |
download | cpython-a5119351519926971240f61d0c23a5fc5d00743e.zip cpython-a5119351519926971240f61d0c23a5fc5d00743e.tar.gz cpython-a5119351519926971240f61d0c23a5fc5d00743e.tar.bz2 |
compare with equality not identity (issue #16172)
Patch from Serhiy Storchaka.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_winsound.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py index 34c3dea..eb7f75f 100644 --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -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 |