Ticket #3413: jython-abstract_concatenate.diff

File jython-abstract_concatenate.diff, 836 bytes (added by Topi Kanerva, 5 years ago)

use PY3 code path in t.i.abstract._concatenate to enable jython

  • twisted/internet/abstract.py

    diff --git a/twisted/internet/abstract.py b/twisted/internet/abstract.py
    index 6e69f4a..cd313d6 100644
    a b Support for generic select()able objects. 
    99from __future__ import division, absolute_import
     11import sys
    1112from socket import AF_INET6, inet_pton, error
    1314from zope.interface import implementer
    from twisted.python.compat import _PY3, unicode, lazyByteSlice 
    1718from twisted.python import _reflectpy3 as reflect, failure
    1819from twisted.internet import interfaces, main
    20 if _PY3:
     21if _PY3 or sys.platform.startswith('java'):
    2122    def _concatenate(bObj, offset, bArray):
    2223        # Python 3 lacks the buffer() builtin and the other primitives don't
    2324        # help in this case.  Just do the copy.  Perhaps later these buffers can