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 | 7c7745a0f2266a790463eb2242d6f94eb4ae95db (patch) | |
tree | 260b46d50bbc3f42fb23af1fe529b69022db7779 | |
parent | 0687395733fe134f5c607d8d5f0a9bb527bdcf7a (diff) | |
download | smartypants-7c7745a0f2266a790463eb2242d6f94eb4ae95db.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): |