Hi guys, I was playing with sandbox and found that the interactive mode does not work because of 'import time'.
Wanted to create a pull request, but for some reason I can't push to bitbucket right now. A simple patch is attached. Cheers - Chris -- Christian Tismer :^) tis...@stackless.com Software Consulting : http://www.stackless.com/ Karl-Liebknecht-Str. 121 : https://github.com/PySide 14482 Potsdam : GPG key -> 0xFB7BEE0E phone +49 173 24 18 776 fax +49 (30) 700143-0023
# HG changeset patch # User Christian Tismer <tis...@stackless.com> # Date 1446672957 -3600 # Branch fix-sandbox # Node ID f4296318c6bf2077c7535cdeebb001a3653aef4a # Parent f48af5699c242d420ade3a0389115c5697af3a03 fix the sandbox interactive shell When the sandbox runs interactivelz, it complains and crashes because of the import on the time module, which is unsupported in sandbox. The patch circumvents this case by intercepting MemoryError. diff --git a/lib_pypy/_pypy_interact.py b/lib_pypy/_pypy_interact.py --- a/lib_pypy/_pypy_interact.py +++ b/lib_pypy/_pypy_interact.py @@ -25,6 +25,12 @@ print(text) except ImportError: pass + except MemoryError: + if sys.pypy_translation_info['translation.sandbox']: + print("sandbox: _pypy_irc_topic has a forbidden import") + pass + else: + raise # try: if not os.isatty(sys.stdin.fileno()):
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev