Rev4016, Add ad test Python 3.4 compatibility

This commit is contained in:
shortcutme 2019-03-21 02:22:22 +01:00
parent 1da6c8c84e
commit 60405bf222
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
5 changed files with 10 additions and 4 deletions

View file

@ -6,6 +6,7 @@ import collections
import math
import warnings
import base64
import binascii
import gevent
import gevent.lock
@ -66,7 +67,7 @@ class UiRequestPlugin(object):
)
if len(piecemap_info["sha512_pieces"]) == 1: # Small file, don't split
hash = piecemap_info["sha512_pieces"][0].hex()
hash = binascii.hexlify(piecemap_info["sha512_pieces"][0].encode())
hash_id = site.content_manager.hashfield.getHashId(hash)
site.content_manager.optionalDownloaded(inner_path, hash_id, upload_info["size"], own=True)