glTF importer: removed future deprecated encoding arg to json.loads

This commit is contained in:
Julien Duroure 2021-01-04 20:36:32 +01:00
parent 70efc485ec
commit 48ec56bde5
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 5, 10),
"version": (1, 5, 11),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -61,7 +61,8 @@ class glTFImporter():
def bad_constant(val):
raise ImportError('Bad glTF: json contained %s' % val)
try:
return json.loads(bytes(content), encoding='utf-8', parse_constant=bad_constant)
text = str(content, encoding='utf-8')
return json.loads(text, parse_constant=bad_constant)
except ValueError as e:
raise ImportError('Bad glTF: json error: %s' % e.args[0])