From b5c328fcfb28fe20cfa24c4223ebed07e833e547 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 19 Feb 2020 20:44:24 +0100 Subject: [PATCH] fix updater --- platformcode/updater.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platformcode/updater.py b/platformcode/updater.py index 7d84db1d..8eb63f37 100644 --- a/platformcode/updater.py +++ b/platformcode/updater.py @@ -15,7 +15,8 @@ try: import urllib.request as urllib except ImportError: import urllib - +import sys +if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int addon = xbmcaddon.Addon('plugin.video.kod') _hdr_pat = re.compile("^@@ -(\d+),?(\d+)? \+(\d+),?(\d+)? @@.*") @@ -259,7 +260,11 @@ def getSha(path): def getShaStr(str): - return githash.blob_hash(BytesIO(str.encode('utf-8')), len(str)).hexdigest() + if PY3: + return githash.blob_hash(BytesIO(str.encode('utf-8')), len(str.encode('utf-8'))).hexdigest() + else: + return githash.blob_hash(BytesIO(str), len(str)).hexdigest() + def updateFromZip(message='Installazione in corso...'):