[pypy-commit] pypy kill-geninterp: Intermediate check-in

arigo noreply at buildbot.pypy.org
Wed Mar 14 19:42:39 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: kill-geninterp
Changeset: r53579:ab50773f602a
Date: 2012-03-14 11:42 -0700
http://bitbucket.org/pypy/pypy/changeset/ab50773f602a/

Log:	Intermediate check-in

diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -176,9 +176,6 @@
                cmdline="--translationmodules",
                suggests=[("objspace.allworkingmodules", False)]),
 
-    BoolOption("geninterp", "specify whether geninterp should be used",
-               default=False),
-
     BoolOption("logbytecodes",
                "keep track of bytecode usage",
                default=False),
@@ -392,10 +389,6 @@
             config.objspace.std.suggest(withsmalllong=True)
         # xxx other options? ropes maybe?
 
-    # completely disable geninterp in a level 0 translation
-    if level == '0':
-        config.objspace.suggest(geninterp=False)
-
     # some optimizations have different effects depending on the typesystem
     if type_system == 'ootype':
         config.objspace.std.suggest(multimethods="doubledispatch")
diff --git a/pypy/config/translationoption.py b/pypy/config/translationoption.py
--- a/pypy/config/translationoption.py
+++ b/pypy/config/translationoption.py
@@ -182,11 +182,6 @@
 
     # Flags of the TranslationContext:
     BoolOption("simplifying", "Simplify flow graphs", default=True),
-    BoolOption("builtins_can_raise_exceptions",
-               "When true, assume any call to a 'simple' builtin such as "
-               "'hex' can raise an arbitrary exception",
-               default=False,
-               cmdline=None),
     BoolOption("list_comprehension_operations",
                "When true, look for and special-case the sequence of "
                "operations that results from a list comprehension and "
diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py
--- a/pypy/interpreter/gateway.py
+++ b/pypy/interpreter/gateway.py
@@ -907,18 +907,12 @@
         self.filename = filename
         self.source = str(py.code.Source(source).deindent())
         self.modname = modname
-        # look at the first three lines for a NOT_RPYTHON tag
-        first = "\n".join(source.split("\n", 3)[:3])
-        if "NOT_RPYTHON" in first:
-            self.can_use_geninterp = False
-        else:
-            self.can_use_geninterp = True
         # make source code available for tracebacks
         lines = [x + "\n" for x in source.split("\n")]
         py.std.linecache.cache[filename] = (1, None, lines, filename)
 
     def __repr__(self):
-        return "<ApplevelClass filename=%r can_use_geninterp=%r>" % (self.filename, self.can_use_geninterp)
+        return "<ApplevelClass filename=%r>" % (self.filename,)
 
     def getwdict(self, space):
         return space.fromcache(ApplevelCache).getorbuild(self)
@@ -979,10 +973,7 @@
 
     def build(self, app):
         "NOT_RPYTHON.  Called indirectly by Applevel.getwdict()."
-        if self.space.config.objspace.geninterp and app.can_use_geninterp:
-            return PyPyCacheDir.build_applevelinterp_dict(app, self.space)
-        else:
-            return build_applevel_dict(app, self.space)
+        return build_applevel_dict(app, self.space)
 
 
 # __________ pure applevel version __________
@@ -996,157 +987,6 @@
                 filename=self.filename)
     return w_glob
 
-# __________ geninterplevel version __________
-
-class PyPyCacheDir:
-    "NOT_RPYTHON"
-    # similar to applevel, but using translation to interp-level.
-    # This version maintains a cache folder with single files.
-
-    def build_applevelinterp_dict(cls, self, space):
-        "NOT_RPYTHON"
-        # N.B. 'self' is the ApplevelInterp; this is a class method,
-        # just so that we have a convenient place to store the global state.
-        if not cls._setup_done:
-            cls._setup()
-
-        from pypy.translator.geninterplevel import translate_as_module
-        import marshal
-        scramble = md5(cls.seed)
-        scramble.update(marshal.dumps(self.source))
-        key = scramble.hexdigest()
-        initfunc = cls.known_code.get(key)
-        if not initfunc:
-            # try to get it from file
-            name = key
-            if self.filename:
-                prename = os.path.splitext(os.path.basename(self.filename))[0]
-            else:
-                prename = 'zznoname'
-            name = "%s_%s" % (prename, name)
-            try:
-                __import__("pypy._cache."+name)
-            except ImportError, x:
-                # print x
-                pass
-            else:
-                initfunc = cls.known_code[key]
-        if not initfunc:
-            # build it and put it into a file
-            initfunc, newsrc = translate_as_module(
-                self.source, self.filename, self.modname)
-            fname = cls.cache_path.join(name+".py").strpath
-            f = file(get_tmp_file_name(fname), "w")
-            print >> f, """\
-# self-destruct on double-click:
-if __name__ == "__main__":
-    from pypy import _cache
-    import os
-    namestart = os.path.join(os.path.split(_cache.__file__)[0], '%s')
-    for ending in ('.py', '.pyc', '.pyo'):
-        try:
-            os.unlink(namestart+ending)
-        except os.error:
-            pass""" % name
-            print >> f
-            print >> f, newsrc
-            print >> f, "from pypy._cache import known_code"
-            print >> f, "known_code[%r] = %s" % (key, initfunc.__name__)
-            f.close()
-            rename_tmp_to_eventual_file_name(fname)
-        w_glob = initfunc(space)
-        return w_glob
-    build_applevelinterp_dict = classmethod(build_applevelinterp_dict)
-
-    _setup_done = False
-
-    def _setup(cls):
-        """NOT_RPYTHON"""
-        lp = py.path.local
-        import pypy, os
-        p = lp(pypy.__file__).new(basename='_cache').ensure(dir=1)
-        cls.cache_path = p
-        ini = p.join('__init__.py')
-        try:
-            if not ini.check():
-                raise ImportError  # don't import if only a .pyc file left!!!
-            from pypy._cache import known_code, \
-                 GI_VERSION_RENDERED
-        except ImportError:
-            GI_VERSION_RENDERED = 0
-        from pypy.translator.geninterplevel import GI_VERSION
-        cls.seed = md5(str(GI_VERSION)).digest()
-        if GI_VERSION != GI_VERSION_RENDERED or GI_VERSION is None:
-            for pth in p.listdir():
-                if pth.check(file=1):
-                    try:
-                        pth.remove()
-                    except: pass
-            f = file(get_tmp_file_name(str(ini)), "w")
-            f.write("""\
-# This folder acts as a cache for code snippets which have been
-# compiled by compile_as_module().
-# It will get a new entry for every piece of code that has
-# not been seen, yet.
-#
-# Caution! Only the code snippet is checked. If something
-# is imported, changes are not detected. Also, changes
-# to geninterplevel or gateway are also not checked.
-# Exception: There is a checked version number in geninterplevel.py
-#
-# If in doubt, remove this file from time to time.
-
-GI_VERSION_RENDERED = %r
-
-known_code = {}
-
-# self-destruct on double-click:
-def harakiri():
-    import pypy._cache as _c
-    import py
-    lp = py.path.local
-    for pth in lp(_c.__file__).dirpath().listdir():
-        try:
-            pth.remove()
-        except: pass
-
-if __name__ == "__main__":
-    harakiri()
-
-del harakiri
-""" % GI_VERSION)
-            f.close()
-            rename_tmp_to_eventual_file_name(str(ini))
-        import pypy._cache
-        cls.known_code = pypy._cache.known_code
-        cls._setup_done = True
-    _setup = classmethod(_setup)
-
-
-def gethostname(_cache=[]):
-    if not _cache:
-        try:
-            import socket
-            hostname = socket.gethostname()
-        except:
-            hostname = ''
-        _cache.append(hostname)
-    return _cache[0]
-
-def get_tmp_file_name(fname):
-    return '%s~%s~%d' % (fname, gethostname(), os.getpid())
-
-def rename_tmp_to_eventual_file_name(fname):
-    # generated files are first written to the host- and process-specific
-    # file 'tmpname', and then atomically moved to their final 'fname'
-    # to avoid problems if py.py is started several times in parallel
-    tmpname = get_tmp_file_name(fname)
-    try:
-        os.rename(tmpname, fname)
-    except (OSError, IOError):
-        os.unlink(fname)    # necessary on Windows
-        os.rename(tmpname, fname)
-
 # ____________________________________________________________
 
 def appdef(source, applevel=ApplevelClass, filename=None):
@@ -1184,11 +1024,6 @@
         return build_applevel_dict(self, space)
 
 
-class applevelinterp_temp(ApplevelClass):
-    hidden_applevel = False
-    def getwdict(self, space):   # no cache
-        return PyPyCacheDir.build_applevelinterp_dict(self, space)
-
 # app2interp_temp is used for testing mainly
 def app2interp_temp(func, applevel_temp=applevel_temp, filename=None):
     """ NOT_RPYTHON """
diff --git a/pypy/interpreter/test/test_appinterp.py b/pypy/interpreter/test/test_appinterp.py
--- a/pypy/interpreter/test/test_appinterp.py
+++ b/pypy/interpreter/test/test_appinterp.py
@@ -1,6 +1,6 @@
 
 import py
-from pypy.interpreter.gateway import appdef, ApplevelClass, applevel_temp, applevelinterp_temp
+from pypy.interpreter.gateway import appdef, ApplevelClass, applevel_temp
 from pypy.interpreter.error import OperationError
 
 def test_execwith_novars(space): 
@@ -82,9 +82,6 @@
     w_res = g(space, space.wrap(10), space.wrap(1))
     assert space.eq_w(w_res, space.wrap(-9))
 
-def test_applevelinterp_functions(space):
-    test_applevel_functions(space, applevel_temp = applevelinterp_temp)
-
 def test_applevel_class(space, applevel_temp = applevel_temp):
     app = applevel_temp('''
         class C(object):
@@ -99,9 +96,6 @@
     w_clsattr = space.getattr(c, space.wrap('attr'))
     assert space.eq_w(w_clsattr, space.wrap(17))
 
-def test_applevelinterp_class(space):
-    test_applevel_class(space, applevel_temp = applevelinterp_temp)
-
 def app_test_something_at_app_level(): 
     x = 2
     assert x/2 == 1
@@ -161,7 +155,7 @@
         w_str = space1.getattr(w_mymod1, space1.wrap("hi"))
         assert space1.str_w(w_str) == "hello"
 
-    def test_geninterp_can_unfreeze(self):
+    def test_random_stuff_can_unfreeze(self):
         # When a module contains an "import" statement in applevel code, the
         # imported module is initialized, possibly after it has been already
         # frozen.
diff --git a/pypy/interpreter/test/test_gateway.py b/pypy/interpreter/test/test_gateway.py
--- a/pypy/interpreter/test/test_gateway.py
+++ b/pypy/interpreter/test/test_gateway.py
@@ -101,14 +101,6 @@
         g3 = gateway.app2interp_temp(noapp_g3, gateway.applevel_temp)
         assert self.space.eq_w(g3(self.space, w('foo'), w('bar')), w('foobar'))
 
-    def test_app2interp2(self):
-        """same but using transformed code"""
-        w = self.space.wrap
-        def noapp_g3(a, b):
-            return a+b
-        g3 = gateway.app2interp_temp(noapp_g3, gateway.applevelinterp_temp)
-        assert self.space.eq_w(g3(self.space, w('foo'), w('bar')), w('foobar'))
-
     def test_app2interp_general_args(self):
         w = self.space.wrap
         def app_general(x, *args, **kwds):
diff --git a/pypy/module/__builtin__/app_inspect.py b/pypy/module/__builtin__/app_inspect.py
--- a/pypy/module/__builtin__/app_inspect.py
+++ b/pypy/module/__builtin__/app_inspect.py
@@ -8,8 +8,6 @@
 from __pypy__ import lookup_special
 
 def _caller_locals(): 
-    # note: the reason why this is working is because the functions in here are
-    # compiled by geninterp, so they don't have a frame
     return sys._getframe(0).f_locals 
 
 def vars(*obj):
@@ -26,17 +24,6 @@
         except AttributeError:
             raise TypeError, "vars() argument must have __dict__ attribute"
 
-# Replaced by the interp-level helper space.callable(): 
-##def callable(ob):
-##    import __builtin__ # XXX this is insane but required for now for geninterp
-##    for c in type(ob).__mro__:
-##        if '__call__' in c.__dict__:
-##            if isinstance(ob, __builtin__._instance): # old style instance!
-##                return getattr(ob, '__call__', None) is not None
-##            return True
-##    else:
-##        return False
-
 def dir(*args):
     """dir([object]) -> list of strings
 
diff --git a/pypy/module/pypyjit/policy.py b/pypy/module/pypyjit/policy.py
--- a/pypy/module/pypyjit/policy.py
+++ b/pypy/module/pypyjit/policy.py
@@ -138,8 +138,6 @@
 
         if mod == 'pypy.rlib.rbigint' or mod == 'pypy.rlib.rlocale' or mod == 'pypy.rlib.rsocket':
             return False
-        if '_geninterp_' in func.func_globals: # skip all geninterped stuff
-            return False
         if mod.startswith('pypy.interpreter.astcompiler.'):
             return False
         if mod.startswith('pypy.interpreter.pyparser.'):
diff --git a/pypy/module/pypyjit/test/test_policy.py b/pypy/module/pypyjit/test/test_policy.py
--- a/pypy/module/pypyjit/test/test_policy.py
+++ b/pypy/module/pypyjit/test/test_policy.py
@@ -14,12 +14,6 @@
     from pypy.rlib.rlocale import setlocale
     assert not pypypolicy.look_inside_function(setlocale)
 
-def test_geninterp():
-    d = {'_geninterp_': True}
-    exec """def f():
-        pass""" in d
-    assert not pypypolicy.look_inside_function(d['f'])
-
 def test_astcompiler():
     from pypy.interpreter.astcompiler import ast
     assert not pypypolicy.look_inside_function(ast.AST.walkabout)
diff --git a/pypy/module/rbench/__init__.py b/pypy/module/rbench/__init__.py
deleted file mode 100644
--- a/pypy/module/rbench/__init__.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Package initialisation
-from pypy.interpreter.mixedmodule import MixedModule
-
-class Module(MixedModule):
-    """geninterpreted benchmarks"""
-
-    appleveldefs = {
-        'pystone': 'app_bench.pystone',
-        'richards': 'app_bench.richards',
-        }
-    
-    interpleveldefs = {}
diff --git a/pypy/module/rbench/app_bench.py b/pypy/module/rbench/app_bench.py
deleted file mode 100644
--- a/pypy/module/rbench/app_bench.py
+++ /dev/null
@@ -1,2 +0,0 @@
-from pypy.translator.test.rpystone import main as pystone
-from pypy.translator.goal.richards import main as richards
diff --git a/pypy/objspace/flow/objspace.py b/pypy/objspace/flow/objspace.py
--- a/pypy/objspace/flow/objspace.py
+++ b/pypy/objspace/flow/objspace.py
@@ -104,7 +104,7 @@
     is_ = None     # real version added by add_operations()
     id  = None     # real version added by add_operations()
 
-    def newdict(self):
+    def newdict(self, module="ignored"):
         if self.concrete_mode:
             return Constant({})
         return self.do_operation('newdict')
@@ -222,10 +222,8 @@
         except UnwrapException:
             raise Exception, "non-constant except guard"
         if check_class in (NotImplementedError, AssertionError):
-            # if we are in geninterp, we cannot catch these exceptions
-            if not self.config.translation.builtins_can_raise_exceptions:
-                raise error.FlowingError("Catching %s is not valid in RPython" %
-                                         check_class.__name__)
+            raise error.FlowingError("Catching %s is not valid in RPython" %
+                                     check_class.__name__)
         if not isinstance(check_class, tuple):
             # the simple case
             return ObjSpace.exception_match(self, w_exc_type, w_check_class)
@@ -439,41 +437,36 @@
         exceptions = [Exception]   # *any* exception by default
         if isinstance(w_callable, Constant):
             c = w_callable.value
-            if not self.config.translation.builtins_can_raise_exceptions:
-                if (isinstance(c, (types.BuiltinFunctionType,
-                                   types.BuiltinMethodType,
-                                   types.ClassType,
-                                   types.TypeType)) and
-                      c.__module__ in ['__builtin__', 'exceptions']):
-                    exceptions = operation.implicit_exceptions.get(c)
+            if (isinstance(c, (types.BuiltinFunctionType,
+                               types.BuiltinMethodType,
+                               types.ClassType,
+                               types.TypeType)) and
+                  c.__module__ in ['__builtin__', 'exceptions']):
+                exceptions = operation.implicit_exceptions.get(c)
         self.handle_implicit_exceptions(exceptions)
         return w_res
 
     def handle_implicit_exceptions(self, exceptions):
         if not exceptions:
             return
-        if not self.config.translation.builtins_can_raise_exceptions:
-            # clean up 'exceptions' by removing the non-RPythonic exceptions
-            # which might be listed for geninterp.
-            exceptions = [exc for exc in exceptions
-                              if exc is not TypeError and
-                                 exc is not AttributeError]
-        if exceptions:
-            # catch possible exceptions implicitly.  If the OperationError
-            # below is not caught in the same function, it will produce an
-            # exception-raising return block in the flow graph.  Note that
-            # even if the interpreter re-raises the exception, it will not
-            # be the same ImplicitOperationError instance internally.
-            context = self.getexecutioncontext()
-            outcome, w_exc_cls, w_exc_value = context.guessexception(*exceptions)
-            if outcome is not None:
-                # we assume that the caught exc_cls will be exactly the
-                # one specified by 'outcome', and not a subclass of it,
-                # unless 'outcome' is Exception.
-                #if outcome is not Exception:
-                    #w_exc_cls = Constant(outcome) Now done by guessexception itself
-                    #pass
-                 raise operation.ImplicitOperationError(w_exc_cls, w_exc_value)
+        for exc in exceptions:    # just for sanity-checking
+            assert exc is not TypeError
+            assert exc is not AttributeError
+        # catch possible exceptions implicitly.  If the OperationError
+        # below is not caught in the same function, it will produce an
+        # exception-raising return block in the flow graph.  Note that
+        # even if the interpreter re-raises the exception, it will not
+        # be the same ImplicitOperationError instance internally.
+        context = self.getexecutioncontext()
+        outcome, w_exc_cls, w_exc_value = context.guessexception(*exceptions)
+        if outcome is not None:
+            # we assume that the caught exc_cls will be exactly the
+            # one specified by 'outcome', and not a subclass of it,
+            # unless 'outcome' is Exception.
+            #if outcome is not Exception:
+                #w_exc_cls = Constant(outcome) Now done by guessexception itself
+                #pass
+             raise operation.ImplicitOperationError(w_exc_cls, w_exc_value)
 
     def w_KeyboardInterrupt(self):
         # the reason to do this is: if you interrupt the flowing of a function
diff --git a/pypy/objspace/flow/specialcase.py b/pypy/objspace/flow/specialcase.py
--- a/pypy/objspace/flow/specialcase.py
+++ b/pypy/objspace/flow/specialcase.py
@@ -49,35 +49,9 @@
         else:
             raise Exception, "should call %r with exactly %d arguments" % (
                 fn, Arity[opname])
-    if space.config.translation.builtins_can_raise_exceptions:
-        # in this mode, avoid constant folding and raise an implicit Exception
-        w_result = space.do_operation(opname, *args_w)
-        space.handle_implicit_exceptions([Exception])
-        return w_result
-    else:
-        # in normal mode, completely replace the call with the underlying
-        # operation and its limited implicit exceptions semantic
-        return getattr(space, opname)(*args_w)
-
-
-# This is not a space cache.
-# It is just collecting the compiled functions from all the source snippets.
-
-class FunctionCache(Cache):
-    """A cache mapping applevel instances to dicts with simple functions"""
-
-    def _build(app):
-        """NOT_RPYTHON.
-        Called indirectly by ApplevelClass.interphook().appcaller()."""
-        dic = {}
-        if not app.can_use_geninterp:
-            return None
-        if app.filename is not None:
-            dic['__file__'] = app.filename
-        dic['__name__'] = app.modname
-        exec py.code.Source(app.source).compile() in dic
-        return dic
-    _build = staticmethod(_build)
+    # completely replace the call with the underlying
+    # operation and its limited implicit exceptions semantic
+    return getattr(space, opname)(*args_w)
 
 # _________________________________________________________________________
 # a simplified version of the basic printing routines, for RPython programs
@@ -101,27 +75,6 @@
     os.write(1, s)
 # _________________________________________________________________________
 
-compiled_funcs = FunctionCache()
-
-def sc_applevel(space, app, name, args_w):
-    dic = compiled_funcs.getorbuild(app)
-    if not dic:
-        return None # signal that this is not RPython
-    func = dic[name]
-    if getattr(func, '_annspecialcase_', '').startswith('flowspace:'):
-        # a hack to replace specific app-level helpers with simplified
-        # RPython versions
-        name = func._annspecialcase_[len('flowspace:'):]
-        if name == 'print_item':    # more special cases...
-            w_s = space.do_operation('str', *args_w)
-            args_w = (w_s,)
-        func = globals()['rpython_' + name]
-    else:
-        # otherwise, just call the app-level helper and hope that it
-        # is RPython enough
-        pass
-    return space.do_operation('simple_call', Constant(func), *args_w)
-
 def sc_r_uint(space, r_uint, args):
     args_w, kwds_w = args.unpack()
     assert not kwds_w
@@ -138,8 +91,6 @@
     # this is now routed through the objspace, directly.
     # space.specialcases[fn] = sc_normalize_exception
     space.specialcases[__import__] = sc_import
-    # redirect ApplevelClass for print et al.
-    space.specialcases[ApplevelClass] = sc_applevel
     # turn calls to built-in functions to the corresponding operation,
     # if possible
     for fn in OperationName:
diff --git a/pypy/objspace/flow/test/test_objspace.py b/pypy/objspace/flow/test/test_objspace.py
--- a/pypy/objspace/flow/test/test_objspace.py
+++ b/pypy/objspace/flow/test/test_objspace.py
@@ -968,61 +968,6 @@
         g = self.codetest(f)
 
 
-class TestGenInterpStyle(Base):
-    def setup_class(cls):
-        cls.space = FlowObjSpace()
-        cls.space.config.translation.builtins_can_raise_exceptions = True
-
-    def reraiseAttributeError(v):
-        try:
-            x = getattr(v, "y")
-        except AttributeError:
-            raise
-
-    def test_reraiseAttributeError(self):
-        x = self.codetest(self.reraiseAttributeError)
-        simplify_graph(x)
-        self.show(x)
-        excfound = []
-        for link in x.iterlinks():
-            if link.target is x.exceptblock:
-                excfound.append(link.exitcase)
-        assert len(excfound) == 2
-        excfound.sort()
-        expected = [Exception, AttributeError]
-        expected.sort()
-        assert excfound == expected
-
-    def reraiseTypeError(dic):
-        try:
-            x = dic[5]
-        except TypeError:
-            raise
-
-    def test_reraiseTypeError(self):
-        x = self.codetest(self.reraiseTypeError)
-        simplify_graph(x)
-        self.show(x)
-        excfound = []
-        for link in x.iterlinks():
-            if link.target is x.exceptblock:
-                excfound.append(link.exitcase)
-        assert len(excfound) == 2
-        excfound.sort()
-        expected = [Exception, TypeError]
-        expected.sort()
-        assert excfound == expected
-
-    def test_can_catch_special_exceptions(self):
-        def f():
-            try:
-                f()
-            except NotImplementedError:
-                pass
-        graph = self.codetest(f)
-        # assert did not crash
-
-
 DATA = {'x': 5,
         'y': 6}
 
diff --git a/pypy/translator/goal/targetpypystandalone.py b/pypy/translator/goal/targetpypystandalone.py
--- a/pypy/translator/goal/targetpypystandalone.py
+++ b/pypy/translator/goal/targetpypystandalone.py
@@ -242,7 +242,6 @@
         filename = os.path.join(this_dir, 'app_main.py')
         app = gateway.applevel(open(filename).read(), 'app_main.py', 'app_main')
         app.hidden_applevel = False
-        app.can_use_geninterp = False
         w_dict = app.getwdict(space)
         entry_point = create_entry_point(space, w_dict)
 
diff --git a/pypy/translator/test/snippet.py b/pypy/translator/test/snippet.py
--- a/pypy/translator/test/snippet.py
+++ b/pypy/translator/test/snippet.py
@@ -648,48 +648,6 @@
     return result
 
 
-# specifically for geninterp testing
-
-def t_isinstance(x, y):
-    return isinstance(x, (int, long)) and isinstance(y, int)
-
-def t_issubclass(x, y):
-    return issubclass(type(x), (int, long)) and issubclass(type(y), int)
-
-def t_neg_long():
-    return -132L
-
-def t_attrerror(x):
-    try:
-        return x.foobar
-    except AttributeError:
-        return 567
-
-
-class Exc(Exception):
-    def __init__(self, v):
-        Exception.__init__(self, v)    
-
-def exception_subclass_sanity(x):
-    try:
-        raise Exc(x)
-    except Exception, e:
-        return e.args[0]
-
-
-class HaveProp(object):
-
-    def __init__(self, v):
-        self.v = v
-
-    def _hi(self):
-        return self.v
-    hi = property(_hi, doc="HaveProp._hi")
-
-
-def run_prop(v):
-    return HaveProp(v).hi
-
 # --------------------(Currently) Non runnable Functions ---------------------
 
 def _somebug1(n=int):
diff --git a/pypy/translator/test/test_rpystone.py b/pypy/translator/test/test_rpystone.py
deleted file mode 100644
--- a/pypy/translator/test/test_rpystone.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from pypy.translator.geninterplevel import translate_as_module, __file__ as __
-from pypy.objspace.std import Space
-import os
-fname = os.path.join(os.path.dirname(__), "test", "rpystone.py")
-src = file(fname).read()
-init, ign = translate_as_module(src)#, tmpname="/tmp/look.py")
-
-LOOPS = 25
-
-def test_rpystone():
-    space = Space()
-    modic = init(space)
-    entry = space.getitem(modic, space.wrap("entrypoint"))
-    # warm-up,to get everything translated
-    space.call(entry, space.newtuple([space.wrap(-1)]))
-    # now this is the real one
-    space.call(entry, space.newtuple([space.wrap(LOOPS)]))
-
-if __name__ == "__main__":
-    test_rpystone()
\ No newline at end of file
diff --git a/pypy/translator/translator.py b/pypy/translator/translator.py
--- a/pypy/translator/translator.py
+++ b/pypy/translator/translator.py
@@ -21,7 +21,6 @@
     FLOWING_FLAGS = {
         'verbose': False,
         'simplifying': True,
-        'builtins_can_raise_exceptions': False,
         'list_comprehension_operations': False,   # True, - not super-tested
         }
 
@@ -31,7 +30,6 @@
             config = get_pypy_config(translating=True)
         # ZZZ should go away in the end
         for attr in ['verbose', 'simplifying',
-                     'builtins_can_raise_exceptions',
                      'list_comprehension_operations']:
             if attr in flowing_flags:
                 setattr(config.translation, attr, flowing_flags[attr])


More information about the pypy-commit mailing list