From: <pj...@us...> - 2008-07-12 00:10:31
|
Revision: 4894 http://jython.svn.sourceforge.net/jython/?rev=4894&view=rev Author: pjenvey Date: 2008-07-11 17:10:28 -0700 (Fri, 11 Jul 2008) Log Message: ----------- fix unicode(str_subclass) not using its __unicode__ method Modified Paths: -------------- branches/asm/src/org/python/core/PyUnicode.java Modified: branches/asm/src/org/python/core/PyUnicode.java =================================================================== --- branches/asm/src/org/python/core/PyUnicode.java 2008-07-11 20:16:53 UTC (rev 4893) +++ branches/asm/src/org/python/core/PyUnicode.java 2008-07-12 00:10:28 UTC (rev 4894) @@ -156,6 +156,9 @@ return new PyUnicode(((PyUnicode) S).string); } if (S instanceof PyString) { + if (S.getType() != PyString.TYPE && encoding == null && errors == null) { + return S.__unicode__(); + } PyObject decoded = codecs.decode((PyString) S, encoding, errors); if (decoded instanceof PyUnicode) { return new PyUnicode((PyUnicode) decoded); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |