fix updater

This commit is contained in:
mac12m99
2019-10-22 18:04:09 +02:00
committed by marco
parent bab1fcadc2
commit b6a12cdbf3

View File

@@ -210,8 +210,13 @@ def apply_patch(s,patch,revert=False):
def getSha(path):
f = open(path).read()
return githash.blob_hash(path, len(f)).hexdigest()
try:
f = open(path, 'rb')
except:
return ''
size = len(f.read())
f.seek(0)
return githash.blob_hash(f, size).hexdigest()
def getShaStr(str):
return githash.blob_hash(StringIO(str), len(str)).hexdigest()