mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-08 19:34:18 +00:00
Merge pull request #839 from tahoe-lafs/3453.downloader-share-python-3
Port allmydata.immutable.downloader.share to Python 3 Fixes ticket:3453
This commit is contained in:
commit
bdf2dcd796
0
newsfragments/3453.minor
Normal file
0
newsfragments/3453.minor
Normal file
@ -1,3 +1,14 @@
|
||||
"""
|
||||
Ported to Python 3.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from future.utils import PY2, native_str
|
||||
if PY2:
|
||||
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
|
||||
|
||||
import struct
|
||||
import time
|
||||
@ -754,7 +765,9 @@ class Share(object):
|
||||
level=log.WEIRD, umid="qZu0wg"))
|
||||
|
||||
def _send_request(self, start, length):
|
||||
return self._rref.callRemote("read", start, length)
|
||||
# For some reason tests fail on Python 2 if this is not a native
|
||||
# string...
|
||||
return self._rref.callRemote(native_str("read"), start, length)
|
||||
|
||||
def _got_data(self, data, start, length, block_ev, lp):
|
||||
block_ev.finished(len(data), now())
|
||||
|
@ -38,6 +38,7 @@ PORTED_MODULES = [
|
||||
"allmydata.immutable.downloader.finder",
|
||||
"allmydata.immutable.downloader.node",
|
||||
"allmydata.immutable.downloader.segmentation",
|
||||
"allmydata.immutable.downloader.share",
|
||||
"allmydata.immutable.downloader.status",
|
||||
"allmydata.immutable.happiness_upload",
|
||||
"allmydata.immutable.literal",
|
||||
|
Loading…
x
Reference in New Issue
Block a user