[pypy-svn] r9135 - in pypy/branch/dist-interpapp/pypy: . interpreter

hpk at codespeak.net hpk at codespeak.net
Fri Feb 11 18:15:41 CET 2005


Author: hpk
Date: Fri Feb 11 18:15:41 2005
New Revision: 9135

Modified:
   pypy/branch/dist-interpapp/pypy/conftest.py
   pypy/branch/dist-interpapp/pypy/interpreter/gateway.py
Log:
appdef() doesn't need to offer overriding the function name (anymore)



Modified: pypy/branch/dist-interpapp/pypy/conftest.py
==============================================================================
--- pypy/branch/dist-interpapp/pypy/conftest.py	(original)
+++ pypy/branch/dist-interpapp/pypy/conftest.py	Fri Feb 11 18:15:41 2005
@@ -125,7 +125,7 @@
         assert not args 
         name = target.func_globals.get('objspacename', None) 
         space = gettestobjspace(name) 
-        func = app2interp_temp(target, target.__name__)
+        func = app2interp_temp(target)
         self.execute_appex(space, func, space)
 
 
@@ -133,7 +133,7 @@
     def execute(self, target, *args): 
         assert not args 
         space = target.im_self.space 
-        func = app2interp_temp(target.im_func, target.__name__) 
+        func = app2interp_temp(target.im_func) 
         self.execute_appex(space, func, space, space.w_None)
 
 class AppClassCollector(py.test.collect.Class): 

Modified: pypy/branch/dist-interpapp/pypy/interpreter/gateway.py
==============================================================================
--- pypy/branch/dist-interpapp/pypy/interpreter/gateway.py	(original)
+++ pypy/branch/dist-interpapp/pypy/interpreter/gateway.py	Fri Feb 11 18:15:41 2005
@@ -562,7 +562,7 @@
     for name, obj in d.items():
         if name.startswith('app_') and name[4:] not in d:
             if isinstance(obj, types.FunctionType):
-                d[name[4:]] = a2i(obj, name[4:])
+                d[name[4:]] = a2i(obj)
 
 def build_dict(d, space):
     """NOT_RPYTHON:
@@ -602,7 +602,7 @@
     assert i != -1
     return d[funcdecl[:i]].func_code 
 
-def appdef(source, overridename=None): 
+def appdef(source): 
     """ NOT_RPYTHON """ 
     from pypy.interpreter.pycode import PyCode
     if not isinstance(source, str): 
@@ -612,10 +612,7 @@
     funcdecl, source = source.strip().split(':', 1)
     #newco = preparesource(source, funcdecl) 
     funcname, decl = funcdecl.split('(', 1)
-    if overridename is not None: 
-        funcname = overridename 
-    else: 
-        funcname = funcname.strip() or 'anonymous'
+    funcname = funcname.strip() or 'anonymous'
     decl = decl.strip()[:-1] 
     wfuncdecl, wfastscope, defaulthandlingsource = specialargparse(decl) 
 
@@ -676,9 +673,9 @@
 
 # for app2interp_temp (used for testing mainly) we can use *args
 class app2interp_temp(object): 
-    def __init__(self, func, overridename=None): 
+    def __init__(self, func): 
         """ NOT_RPYTHON """
-        self.appfunc = appdef(func, overridename) 
+        self.appfunc = appdef(func) 
 
     def __call__(self, space, *args_w, **kwargs_w): 
         """ NOT_RPYTHON """



More information about the Pypy-commit mailing list