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,7 +414,11 @@ else:
_assertRaisesRegex = "assertRaisesRegexp" _assertRaisesRegex = "assertRaisesRegexp"
_assertRegex = "assertRegexpMatches" _assertRegex = "assertRegexpMatches"
# memoryview and buffer are not stricly equivalent, but should be fine for # memoryview and buffer are not stricly equivalent, but should be fine for
# django core usage (mainly BinaryField) # 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 memoryview = buffer