fix addons load in python2

This commit is contained in:
DjLegolas 2022-05-07 19:16:11 +03:00 committed by Patrick
parent 2dd7636134
commit 6da8f97e37

View File

@ -146,8 +146,8 @@ class Plugin:
def loadfile(self, filename): def loadfile(self, filename):
try: try:
self.filename = filename self.filename = filename
with open(filename, encoding='utf-8') as f: with open(filename, 'rb') as f:
data = f.read() data = f.read().decode('utf-8')
compiled = compile_file(data, filename) compiled = compile_file(data, filename)
exec(compiled, self.globals) exec(compiled, self.globals)