Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r65073:b07a14bc6fb7
Date: 2013-06-28 19:59 +0200
http://bitbucket.org/pypy/pypy/changeset/b07a14bc6fb7/

Log:    If we are running on top of pypy, we import only _minimal_curses.
        Don't try to fall back to _curses, because that's going to use cffi
        and fall again more loudly.

diff --git a/lib_pypy/pyrepl/curses.py b/lib_pypy/pyrepl/curses.py
--- a/lib_pypy/pyrepl/curses.py
+++ b/lib_pypy/pyrepl/curses.py
@@ -19,11 +19,15 @@
 # CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# avoid importing the whole curses, if possible
-try:
+# If we are running on top of pypy, we import only _minimal_curses.
+# Don't try to fall back to _curses, because that's going to use cffi
+# and fall again more loudly.
+import sys
+if '__pypy__' in sys.builtin_module_names:
     # pypy case
     import _minimal_curses as _curses
-except ImportError:
+else:
+    # cpython case
     try:
         import _curses
     except ImportError:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to