Commit 6fc7a17d authored by Kevin Modzelewski's avatar Kevin Modzelewski

Raise this as an ImportError instead of SystemError

With the recent package import support, we broke importing optparse.
This is because we now can import "encodings" (a package), which imports
codecs, which raises a SystemError when trying to import _codecs which
we don't support yet.

This was getting ignored before since optparse wrapped this process
(which happens via "import gettext") in a try-except and catches the
ImportError.
parent fae676cd
......@@ -14,7 +14,11 @@ import __builtin__, sys
try:
from _codecs import *
except ImportError, why:
raise SystemError('Failed to load the builtin codecs: %s' % why)
# Pyston change: for now, let the ImportError propagate instead of
# converting to a SystemError. This leads to better handling by
# the importer
raise
# raise SystemError('Failed to load the builtin codecs: %s' % why)
__all__ = ["register", "lookup", "open", "EncodedFile", "BOM", "BOM_BE",
"BOM_LE", "BOM32_BE", "BOM32_LE", "BOM64_BE", "BOM64_LE",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment