Skip to content

Commit 793ead5

Browse files
author
Finn Bock
committed
A workaround for the missing buffer() builtin in jython.
This closes patch "[ #490850 ] Jython and test_StringIO".
1 parent 82b2307 commit 793ead5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_StringIO.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ class TestStringIO(TestGenericStringIO):
7474
class TestcStringIO(TestGenericStringIO):
7575
MODULE = cStringIO
7676

77+
import sys
78+
if sys.platform.startswith('java'):
79+
# Jython doesn't have a buffer object, so we just do a useless
80+
# fake of the buffer tests.
81+
buffer = str
82+
7783
class TestBufferStringIO(TestStringIO):
7884
constructor = buffer
7985

0 commit comments

Comments
 (0)