Use preferred exception raising syntax.

Also, make the `WindowsError` class "reachable".
This commit is contained in:
Jean-Paul Calderone 2018-04-26 15:27:00 -04:00
parent b6d33c92ff
commit 3705264740

View File

@ -5,9 +5,9 @@ _AMD_KEY = r"Software\Allmydata"
_BDIR_KEY = 'Base Dir Path'
if sys.platform not in ('win32'):
raise ImportError, "registry cannot be used on non-windows systems"
class WindowsError(Exception): # stupid voodoo to appease pyflakes
pass
raise ImportError("registry cannot be used on non-windows systems")
def get_registry_setting(key, name, _topkey=None):
"""