From: <fwi...@us...> - 2009-08-16 14:26:13
|
Revision: 6677 http://jython.svn.sourceforge.net/jython/?rev=6677&view=rev Author: fwierzbicki Date: 2009-08-16 14:26:06 +0000 (Sun, 16 Aug 2009) Log Message: ----------- Fix for http://bugs.jython.org/issue1439: Can't write() array.array Modified Paths: -------------- trunk/jython/src/org/python/core/PyFile.java Modified: trunk/jython/src/org/python/core/PyFile.java =================================================================== --- trunk/jython/src/org/python/core/PyFile.java 2009-08-16 10:28:49 UTC (rev 6676) +++ trunk/jython/src/org/python/core/PyFile.java 2009-08-16 14:26:06 UTC (rev 6677) @@ -354,8 +354,12 @@ file_write(o.__str__().string); } else if (o instanceof PyString) { file_write(((PyString)o).string); + } else if (o instanceof PyArray) { + ((PyArray)o).tofile(this); } else { - throw Py.TypeError("write requires a string as its argument"); + //XXX: Match CPython's error message better + // "argument 1 must be string or read-only buffer, not {type}" + throw Py.TypeError("write requires a string or read-only buffer as its argument"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |