[pywin32-checkins] pywin32/win32/Lib regutil.py,1.5,1.6
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-01-05 10:57:58
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29788/win32/Lib Modified Files: regutil.py Log Message: remove use of types module and modern raise() syntax Index: regutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regutil.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** regutil.py 23 Oct 2008 07:39:12 -0000 1.5 --- regutil.py 5 Jan 2009 10:57:53 -0000 1.6 *************** *** 31,42 **** """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: typeId = win32con.REG_SZ ! elif type(value)==types.IntType: typeId = win32con.REG_DWORD else: ! raise TypeError("Value must be string or integer - was passed " + str(value)) win32api.RegSetValue(rootkey, subKey, typeId ,value) --- 31,41 ---- """A helper to set the default value for a key in the registry """ if rootkey is None: rootkey = GetRootKey() ! if type(value)==str: typeId = win32con.REG_SZ ! elif type(value)==int: typeId = win32con.REG_DWORD else: ! raise TypeError("Value must be string or integer - was passed " + repr(value)) win32api.RegSetValue(rootkey, subKey, typeId ,value) |