[pypy-svn] r46397 - pypy/dist/pypy/translator/sandbox
arigo at codespeak.net
arigo at codespeak.net
Fri Sep 7 14:35:28 CEST 2007
Author: arigo
Date: Fri Sep 7 14:35:25 2007
New Revision: 46397
Modified:
pypy/dist/pypy/translator/sandbox/sandlib.py
Log:
Turn this AttributeError into a RuntimeError,
which can be reported to the subprocess.
Modified: pypy/dist/pypy/translator/sandbox/sandlib.py
==============================================================================
--- pypy/dist/pypy/translator/sandbox/sandlib.py (original)
+++ pypy/dist/pypy/translator/sandbox/sandlib.py Fri Sep 7 14:35:25 2007
@@ -236,7 +236,10 @@
def handle_message(self, fnname, *args):
if '__' in fnname:
raise ValueError("unsafe fnname")
- handler = getattr(self, 'do_' + fnname.replace('.', '__'))
+ try:
+ handler = getattr(self, 'do_' + fnname.replace('.', '__'))
+ except AttributeError:
+ raise RuntimeError("no handler for this function")
resulttype = getattr(handler, 'resulttype', None)
return handler(*args), resulttype
More information about the Pypy-commit
mailing list