Handle sys.getfilesystemencoding() returning None

This commit is contained in:
Odd Stråbø 2020-04-21 12:48:30 +02:00
parent 5db16141cc
commit b67f7a8c51
4 changed files with 20 additions and 7 deletions

View file

@ -5,11 +5,10 @@ from __future__ import division, absolute_import, print_function, unicode_litera
import json
import os
import sys
from six import iteritems, ensure_text
from helper import LazyLogger
from helper import LazyLogger, get_filesystem_encoding
##################################################################################################
@ -34,7 +33,7 @@ class Objects(object):
''' Load objects mapping.
'''
file_dir = os.path.dirname(ensure_text(__file__, sys.getfilesystemencoding()))
file_dir = os.path.dirname(ensure_text(__file__, get_filesystem_encoding()))
with open(os.path.join(file_dir, 'obj_map.json')) as infile:
self.objects = json.load(infile)