File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,30 @@ from platform import python_implementation
25
25
{%block compat_block%}
26
26
PY2 = sys.version_info[0] == 2
27
27
PY26 = PY2 and sys.version_info[1] < 7
28
+ PY33 = sys.version_info < (3, 4)
28
29
{%endblock%}
29
30
31
+ # Work around mbcs bug in distutils.
32
+ # http://bugs.python.org/issue10945
33
+ # This work around is only if a project supports Python < 3.4
34
+ {% if PY33 %}
35
+ try:
36
+ codecs.lookup('mbcs')
37
+ except LookupError:
38
+ ascii = codecs.lookup('ascii')
39
+ func = lambda name, enc=ascii: {True: enc}.get(name=='mbcs')
40
+ codecs.register(func)
41
+ {% endif %}
42
+
43
+ # Work around for locale not being set
44
+ try:
45
+ lc = locale.getlocale()
46
+ pf = platform.system()
47
+ if pf != 'Windows' and lc == (None, None):
48
+ locale.setlocale(locale.LC_ALL, 'C.UTF-8')
49
+ except (ValueError, UnicodeError, locale.Error):
50
+ locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
51
+
30
52
NAME = '{{name}}'
31
53
AUTHOR = '{{author}}'
32
54
VERSION = '{{current_version}}'
You can’t perform that action at this time.
0 commit comments