Update of /cvsroot/pywin32/pywin32/win32/Lib
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/win32/Lib
Modified Files:
Tag: py3k
regutil.py
Log Message:
merge lots of changes (most via 2to3) from the trunk
Index: regutil.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regutil.py,v
retrieving revision 1.3.4.3
retrieving revision 1.3.4.4
diff -C2 -d -r1.3.4.3 -r1.3.4.4
*** regutil.py 27 Nov 2008 11:31:05 -0000 1.3.4.3
--- regutil.py 5 Jan 2009 12:51:27 -0000 1.3.4.4
***************
*** 31,44 ****
"""A helper to set the default value for a key in the registry
"""
- import types
if rootkey is None: rootkey = GetRootKey()
! if isinstance(value, str):
typeId = win32con.REG_SZ
! elif isinstance(value, bytes):
! typeId = win32con.REG_BINARY
! elif isinstance(value, int):
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)
|