]> granicus.if.org Git - python/commitdiff
A workaround for the missing buffer() builtin in jython.
authorFinn Bock <bckfnn@worldonline.dk>
Sun, 9 Dec 2001 20:06:32 +0000 (20:06 +0000)
committerFinn Bock <bckfnn@worldonline.dk>
Sun, 9 Dec 2001 20:06:32 +0000 (20:06 +0000)
This closes patch "[ #490850 ] Jython and test_StringIO".

Lib/test/test_StringIO.py

index 33db4ba5bcd7016243d27b453ccc2560390f5628..8b934fffcdfe1151ca4972ea7f328be247b27728 100644 (file)
@@ -74,6 +74,12 @@ class TestStringIO(TestGenericStringIO):
 class TestcStringIO(TestGenericStringIO):
     MODULE = cStringIO
 
+import sys
+if sys.platform.startswith('java'):
+    # Jython doesn't have a buffer object, so we just do a useless
+    # fake of the buffer tests.
+    buffer = str
+
 class TestBufferStringIO(TestStringIO):
     constructor = buffer