Merge pull request #3443 from jepler/python-version-compat

makeqstrdata: Work with older Python
This commit is contained in:
Dan Halbert 2020-09-20 10:18:21 -04:00 committed by GitHub
commit 8eda9174b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,8 +17,9 @@ import collections
import gettext
import os.path
sys.stdout.reconfigure(encoding='utf-8')
sys.stderr.reconfigure(errors='backslashreplace')
if hasattr(sys.stdout, 'reconfigure'):
sys.stdout.reconfigure(encoding='utf-8')
sys.stderr.reconfigure(errors='backslashreplace')
py = os.path.dirname(sys.argv[0])
top = os.path.dirname(py)