Skip to content

Commit

Permalink
remove use of types module and modern raise() syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mhammond committed Jan 5, 2009
1 parent 34c3dc5 commit a884628
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions win32/Lib/regutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ def GetRegistryDefaultValue(subkey, rootkey = None):
def SetRegistryDefaultValue(subKey, value, rootkey = None):
"""A helper to set the default value for a key in the registry
"""
import types
if rootkey is None: rootkey = GetRootKey()
if type(value)==types.StringType:
if type(value)==str:
typeId = win32con.REG_SZ
elif type(value)==types.IntType:
elif type(value)==int:
typeId = win32con.REG_DWORD
else:
raise TypeError("Value must be string or integer - was passed " + str(value))
raise TypeError("Value must be string or integer - was passed " + repr(value))

win32api.RegSetValue(rootkey, subKey, typeId ,value)

Expand Down

0 comments on commit a884628

Please sign in to comment.