Issue #16719: Get rid of WindowsError. Use OSError instead

Patch by Serhiy Storchaka.
This commit is contained in:
Andrew Svetlov 2012-12-19 14:33:35 +02:00
parent 8a045cb93b
commit 2606a6f197
28 changed files with 79 additions and 87 deletions

View file

@ -22,7 +22,7 @@ def has_sound(sound):
key = winreg.OpenKeyEx(winreg.HKEY_CURRENT_USER,
"AppEvents\Schemes\Apps\.Default\{0}\.Default".format(sound))
return winreg.EnumValue(key, 0)[1] != ""
except WindowsError:
except OSError:
return False
class BeepTest(unittest.TestCase):