bazarr/libs/subzero/sandbox.py
Louis Vézina 3ca2c98cd4 WIP
2019-09-16 22:04:27 -04:00

16 lines
527 B
Python

# coding=utf-8
from __future__ import absolute_import
import sys
def fix_environment_stuff(module, base):
# restore builtins
module.__builtins__ = [x for x in base.__class__.__base__.__subclasses__() if x.__name__ == 'catch_warnings'][0]()._module.__builtins__
# patch getfilesystemencoding for NVIDIA Shield
getfilesystemencoding_orig = sys.getfilesystemencoding
def getfilesystemencoding():
return getfilesystemencoding_orig() or "utf-8"
sys.getfilesystemencoding = getfilesystemencoding