Index: textwrap.py =================================================================== --- textwrap.py (revision 54885) +++ textwrap.py (working copy) @@ -7,8 +7,10 @@ __revision__ = "$Id$" -import string, re +# Amended for jython by Tim Couper 20 Apr 2007 +import string, re, sys + # Do the right thing with boolean values for all known Python versions # (so this module can be copied to projects that don't depend on Python # 2.3, e.g. Optik and Docutils). @@ -128,7 +130,11 @@ if isinstance(text, str): text = text.translate(self.whitespace_trans) elif isinstance(text, unicode): - text = text.translate(self.unicode_whitespace_trans) + if sys.platform.startswith('java'): + # Jython: unicode has no translate method + return text + else: + text = text.translate(self.unicode_whitespace_trans) return text