Update of /cvsroot/pywin32/pywin32/com/win32com/client
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6704/client
Modified Files:
genpy.py
Log Message:
Remove stale/broken __unicode__ method in py3k
Index: genpy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** genpy.py 30 Aug 2010 00:52:15 -0000 1.68
--- genpy.py 13 Nov 2010 06:08:16 -0000 1.69
***************
*** 487,500 ****
for line in ret:
print >> stream, line
- print >> stream, "\t# str(ob) and int(ob) will use __call__"
- print >> stream, "\tdef __unicode__(self, *args):"
- print >> stream, "\t\ttry:"
- print >> stream, "\t\t\treturn unicode(self.__call__(*args))"
- print >> stream, "\t\texcept pythoncom.com_error:"
- print >> stream, "\t\t\treturn repr(self)"
- print >> stream, "\tdef __str__(self, *args):"
if sys.version_info > (3,0):
print >> stream, "\t\treturn str(self.__call__(*args))"
else:
print >> stream, "\t\treturn str(self.__unicode__(*args))"
print >> stream, "\tdef __int__(self, *args):"
--- 487,500 ----
for line in ret:
print >> stream, line
if sys.version_info > (3,0):
+ print >> stream, "\tdef __str__(self, *args):"
print >> stream, "\t\treturn str(self.__call__(*args))"
else:
+ print >> stream, "\tdef __unicode__(self, *args):"
+ print >> stream, "\t\ttry:"
+ print >> stream, "\t\t\treturn unicode(self.__call__(*args))"
+ print >> stream, "\t\texcept pythoncom.com_error:"
+ print >> stream, "\t\t\treturn repr(self)"
+ print >> stream, "\tdef __str__(self, *args):"
print >> stream, "\t\treturn str(self.__unicode__(*args))"
print >> stream, "\tdef __int__(self, *args):"
|