Permalink
Browse files

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

  • Loading branch information...
1 parent 15c3906 commit 35cab0f8e43c01a7d5ede4ebc96e5e8723a04338 @beachmachine beachmachine committed with jacobian Mar 27, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 django/utils/six.py
View
8 django/utils/six.py
@@ -414,8 +414,12 @@ def with_metaclass(meta, base=object):
_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):

0 comments on commit 35cab0f

Please sign in to comment.