dist: Disable _bootlocale injection for Python 3.10+

Python 3.10 removed the _bootlocale module (see bpo-42208)

[skip ci]
This commit is contained in:
rdb 2022-03-15 11:20:00 +01:00
parent 930e5da438
commit cafcdede5f

View File

@ -157,7 +157,7 @@ from _frozen_importlib import _imp, FrozenImporter
sys.frozen = True
if sys.platform == 'win32':
if sys.platform == 'win32' and sys.version_info < (3, 10):
# Make sure the preferred encoding is something we actually support.
import _bootlocale
enc = _bootlocale.getpreferredencoding().lower()