Skip to content

Commit 8eda917

Browse files
authored
Merge pull request #3443 from jepler/python-version-compat
makeqstrdata: Work with older Python
2 parents ce26642 + bfbbbd6 commit 8eda917

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

py/makeqstrdata.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
import gettext
1818
import os.path
1919

20-
sys.stdout.reconfigure(encoding='utf-8')
21-
sys.stderr.reconfigure(errors='backslashreplace')
20+
if hasattr(sys.stdout, 'reconfigure'):
21+
sys.stdout.reconfigure(encoding='utf-8')
22+
sys.stderr.reconfigure(errors='backslashreplace')
2223

2324
py = os.path.dirname(sys.argv[0])
2425
top = os.path.dirname(py)

0 commit comments

Comments
 (0)