[pywin32-checkins] pywin32/com/win32comext/axscript/client error.py, 1.11, 1.12
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-01-04 13:45:06
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25667/com/win32comext/axscript/client Modified Files: error.py Log Message: Fix activescript exception handling on py3k Index: error.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/error.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** error.py 27 Nov 2008 03:53:25 -0000 1.11 --- error.py 4 Jan 2009 13:45:02 -0000 1.12 *************** *** 164,184 **** bits.extend(traceback.format_exception_only(exc_type, value)) ! # XXX - this block appears completely bogus??? The UTF8 ! # comment below is from well before py3k, so utf8 doesn't have ! # any special status in py2k. Most likely is that this was ! # simply an artifact of an invalid test (which remains - it ! # raises a RuntimeError with a *string* with extended ! # characters.) ! # Sadly, the test still fails in the same way if you raise a ! # Unicode string with an extended char. This block keeps the ! # tests passing, so it remains. ! # XXX - todo - read the above, and fix below! ! ! # all items in the list are utf8 courtesy of Python magically ! # converting unicode to utf8 before compilation. ! for i in xrange(len(bits)): ! if type(bits[i]) is str: ! #assert type(bits[i]) is str, type(bits[i]) ! bits[i] = bits[i].decode('utf8') self.description = ExpandTabs(u''.join(bits)) --- 164,181 ---- bits.extend(traceback.format_exception_only(exc_type, value)) ! # XXX - this utf8 encoding seems bogus. From well before py3k, ! # we had the comment: ! # > all items in the list are utf8 courtesy of Python magically ! # > converting unicode to utf8 before compilation. ! # but that is likely just confusion from early unicode days; ! # Python isn't doing it, pywin32 probably was, so 'mbcs' would ! # be the default encoding. We should never hit this these days ! # anyway, but on py3k, we *never* will, and str objects there ! # don't have a decode method... ! if sys.version_info < (3,): ! for i in xrange(len(bits)): ! if type(bits[i]) is str: ! #assert type(bits[i]) is str, type(bits[i]) ! bits[i] = bits[i].decode('utf8') self.description = ExpandTabs(u''.join(bits)) |