diff options
author | Yu-Jie Lin <livibetter@gmail.com> | 2014-07-19 19:11:00 +0800 |
---|---|---|
committer | Yu-Jie Lin <livibetter@gmail.com> | 2014-07-19 19:11:00 +0800 |
commit | 6346421b53a4bb57e677f14a2aa0c3d95381e853 (patch) | |
tree | 260b46d50bbc3f42fb23af1fe529b69022db7779 | |
parent | c508c11acef1930a956866fc259fc2b4bc43a732 (diff) | |
download | smartypants-git-6346421b53a4bb57e677f14a2aa0c3d95381e853.tar.gz |
fix codecs mbcs bug in distutils
-rwxr-xr-x | setup.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -40,6 +40,19 @@ EXCLUDE_SCRIPTS = ( # ============================================================================ +# https://groups.google.com/d/msg/comp.lang.python/pAeiF0qwtY0/H9Ki0WOctBkJ +# Work around mbcs bug in distutils. +# http://bugs.python.org/issue10945 + +try: + codecs.lookup('mbcs') +except LookupError: + ascii = codecs.lookup('ascii') + func = lambda name, enc=ascii: {True: enc}.get(name == 'mbcs') + codecs.register(func) + + +# ============================================================================ class cmd_test(Command): |