diff -r d7d3e1a03fe0 Lib/test/test_winsound.py --- a/Lib/test/test_winsound.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Lib/test/test_winsound.py Tue Oct 09 12:40:57 2012 +0300 @@ -16,16 +16,12 @@ 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