mirror of
https://github.com/9001/copyparty.git
synced 2026-03-18 22:22:58 +10:00
py2 fix
This commit is contained in:
@@ -290,6 +290,8 @@ class Up2k(object):
|
||||
mtpq = "(?)"
|
||||
if up_en:
|
||||
ups = [(1, 0, 0, time.time(), "cannot show list (server too busy)")]
|
||||
if PY2:
|
||||
ups = []
|
||||
|
||||
ups.sort(reverse=True)
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ from __future__ import print_function, unicode_literals
|
||||
import argparse
|
||||
import base64
|
||||
import binascii
|
||||
import codecs
|
||||
import errno
|
||||
import hashlib
|
||||
import hmac
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
import math
|
||||
@@ -3668,7 +3668,7 @@ def load_resource(E: EnvParams, name: str, mode="rb") -> IO[bytes]:
|
||||
if _pkg_resource_exists(E.pkg.__name__, name):
|
||||
stream = pkg_resources.resource_stream(E.pkg.__name__, name)
|
||||
if enc:
|
||||
stream = io.TextIOWrapper(stream, encoding=enc)
|
||||
stream = codecs.getreader(enc)(stream)
|
||||
return stream
|
||||
|
||||
return open(os.path.join(E.mod, name), mode, encoding=enc)
|
||||
|
||||
Reference in New Issue
Block a user