diff options
| author | Andreas <andreas@st0cker.at> | 2013-03-27 13:37:40 -0500 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2013-03-27 13:39:52 -0500 |
| commit | 35cab0f8e43c01a7d5ede4ebc96e5e8723a04338 (patch) | |
| tree | 307841fb808e8e72d4d8b9029303e2ea42a4819b | |
| parent | 15c3906eeb827aad1fdfcb1cd58990dc56b76ae1 (diff) | |
Fixed #20016: worked around Jython not having a buffer.
| -rw-r--r-- | django/utils/six.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/django/utils/six.py b/django/utils/six.py index 9633640b80..a5eca73ecf 100644 --- a/django/utils/six.py +++ b/django/utils/six.py @@ -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): |
