Fixed #20016: worked around Jython not having a buffer.

This commit is contained in:
Andreas 2013-03-27 13:37:40 -05:00 committed by Jacob Kaplan-Moss
parent 15c3906eeb
commit 35cab0f8e4
1 changed files with 6 additions and 2 deletions

View File

@ -414,8 +414,12 @@ else:
_assertRaisesRegex = "assertRaisesRegexp"
_assertRegex = "assertRegexpMatches"
# memoryview and buffer are not stricly equivalent, but should be fine for
# django core usage (mainly BinaryField)
memoryview = buffer
# django core usage (mainly BinaryField). However, Jython doesn't support
# buffer (see http://bugs.jython.org/issue1521), so we have to be careful.
if sys.platform.startswith('java'):
memoryview = memoryview
else:
memoryview = buffer
def assertRaisesRegex(self, *args, **kwargs):