Commits

Amaury Forgeot d'Arc  committed 5d9c94d Merge

hg merge default

  • Participants
  • Parent commits 6844023, af7add5
  • Branches remove-PYPY_NOT_MAIN_FILE

Comments (0)

Files changed (379)

 b48df0bf4e75b81d98f19ce89d4a7dc3e1dab5e5 benchmarked
 d8ac7d23d3ec5f9a0fa1264972f74a010dbfd07f release-1.6
 ff4af8f318821f7f5ca998613a60fca09aa137da release-1.7
+07e08e9c885ca67d89bcc304e45a32346daea2fa release-2.0-beta-1
-License for files in the pypy/ directory 
-==================================================
+License
+=======
 
 Except when otherwise stated (look for LICENSE files in directories or
 information at the beginning of each file) all software and
-documentation in the 'pypy' directories is licensed as follows: 
+documentation in the 'pypy', 'ctype_configure', 'dotviewer', 'demo',
+and 'lib_pypy' directories is licensed as follows: 
 
     The MIT License
 

File lib-python/2.7/distutils/command/build_ext.py

         shared extension.  On most platforms, this is just 'ext.libraries';
         on Windows and OS/2, we add the Python library (eg. python20.dll).
         """
+        # For PyPy, we must not add any such Python library, on any platform
+        if "__pypy__" in sys.builtin_module_names:
+            return ext.libraries
         # The python library is always needed on Windows.
         if sys.platform == "win32":
             template = "python%d%d"

File lib-python/conftest.py

 from pypy.interpreter.main import run_string, run_file
 
 # the following adds command line options as a side effect! 
-from pypy.conftest import gettestobjspace, option as pypy_option 
+from pypy.conftest import option as pypy_option 
 
 from pypy.tool.pytest import appsupport 
 from pypy.tool.pytest.confpath import pypydir, testdir, testresultdir

File lib_pypy/_sqlite3.py

                 self.statement.reset()
                 raise self.connection._get_exception(ret)
 
+            if self.statement.kind == DML:
+                self.statement.reset()
+
             if self.statement.kind == DQL and ret == SQLITE_ROW:
                 self.statement._build_row_cast_map()
                 self.statement._readahead(self)
                 self.statement.item = None
                 self.statement.exhausted = True
 
-            if self.statement.kind == DML:
-                self.statement.reset()
-
             self.rowcount = -1
             if self.statement.kind == DML:
                 self.rowcount = sqlite.sqlite3_changes(self.connection.db)

File pypy/annotation/bookkeeper.py

File contents unchanged.

File pypy/annotation/model.py

                 desc, = descriptions
                 if desc.pyobj is not None:
                     self.const = desc.pyobj
+            elif len(descriptions) > 1:
+                from pypy.annotation.description import ClassDesc
+                if self.getKind() is ClassDesc:
+                    # a PBC of several classes: enforce them all to be
+                    # built, without support for specialization.  See
+                    # rpython/test/test_rpbc.test_pbc_of_classes_not_all_used
+                    for desc in descriptions:
+                        desc.getuniqueclassdef()
 
     def any_description(self):
         return iter(self.descriptions).next()
     return r
 
 def not_const(s_obj):
-    if s_obj.is_constant():
+    if s_obj.is_constant() and not isinstance(s_obj, SomePBC):
         new_s_obj = SomeObject.__new__(s_obj.__class__)
         dic = new_s_obj.__dict__ = s_obj.__dict__.copy()
         if 'const' in dic:

File pypy/bin/py.py

     config, parser = option.get_standard_options()
     interactiveconfig = Config(cmdline_optiondescr)
     to_optparse(interactiveconfig, parser=parser)
+    def set_family_of_options(option, opt, value, parser):
+        from pypy.config.pypyoption import set_pypy_opt_level
+        set_pypy_opt_level(config, value)
     parser.add_option(
         '--cc', type=str, action="callback",
         callback=set_compiler,
         help="Compiler to use for compiling generated C")
+    parser.add_option(
+        '--opt', type=str, action="callback",
+        callback=set_family_of_options,
+        help="Set the family of options based on -opt=0,1,2,jit...")
     args = option.process_options(parser, argv[1:])
     if interactiveconfig.verbose:
         error.RECORD_INTERPLEVEL_TRACEBACK = True

File pypy/config/pypyoption.py

         config.objspace.std.suggest(builtinshortcut=True)
         config.objspace.std.suggest(optimized_list_getitem=True)
         config.objspace.std.suggest(getattributeshortcut=True)
-        config.objspace.std.suggest(newshortcut=True)
+        #config.objspace.std.suggest(newshortcut=True)
         config.objspace.std.suggest(withspecialisedtuple=True)
         config.objspace.std.suggest(withidentitydict=True)
         #if not IS_64_BITS:

File pypy/config/test/test_pypyoption.py

 def test_set_pypy_opt_level():
     conf = get_pypy_config()
     set_pypy_opt_level(conf, '2')
-    assert conf.objspace.std.newshortcut
+    assert conf.objspace.std.getattributeshortcut
     conf = get_pypy_config()
     set_pypy_opt_level(conf, '0')
-    assert not conf.objspace.std.newshortcut
+    assert not conf.objspace.std.getattributeshortcut
 
 def test_rweakref_required():
     conf = get_pypy_config()

File pypy/config/translationoption.py

     BoolOption("no__thread",
                "don't use __thread for implementing TLS",
                default=False, cmdline="--no__thread", negation=False),
-    StrOption("compilerflags", "Specify flags for the C compiler",
-               cmdline="--cflags"),
-    StrOption("linkerflags", "Specify flags for the linker (C backend only)",
-               cmdline="--ldflags"),
+##  --- not supported since a long time.  Use the env vars CFLAGS/LDFLAGS.
+##    StrOption("compilerflags", "Specify flags for the C compiler",
+##               cmdline="--cflags"),
+##    StrOption("linkerflags", "Specify flags for the linker (C backend only)",
+##               cmdline="--ldflags"),
     IntOption("make_jobs", "Specify -j argument to make for compilation"
               " (C backend only)",
               cmdline="--make-jobs", default=detect_number_of_processors()),

File pypy/conftest.py

-import py, pytest, sys, os, textwrap, types
-from pypy.interpreter.gateway import app2interp_temp
-from pypy.interpreter.error import OperationError
-from pypy.interpreter.function import Method
-from pypy.tool.pytest import appsupport
-from pypy.tool.option import make_config, make_objspace
-from pypy.config.config import ConflictConfigError
-from inspect import isclass, getmro
-from pypy.tool.udir import udir
-from pypy.tool.autopath import pypydir
-from pypy.tool import leakfinder
+import py, pytest, sys, os, textwrap
+from inspect import isclass
 
 # pytest settings
 rsyncdirs = ['.', '../lib-python', '../lib_pypy', '../demo']
 def pytest_report_header():
     return "pytest-%s from %s" %(pytest.__version__, pytest.__file__)
 
+
+def pytest_addhooks(pluginmanager):
+    from pypy.tool.pytest.plugins import LeakFinder
+    pluginmanager.register(LeakFinder())
+
+
 def pytest_configure(config):
     global option
     option = config.option
         pass
 
 def pytest_funcarg__space(request):
+    from pypy.tool.pytest.objspace import gettestobjspace
     spaceconfig = getattr(request.cls, 'spaceconfig', {})
     return gettestobjspace(**spaceconfig)
 
-_SPACECACHE={}
-def gettestobjspace(name=None, **kwds):
-    """ helper for instantiating and caching space's for testing.
-    """
-    try:
-        config = make_config(option, objspace=name, **kwds)
-    except ConflictConfigError, e:
-        # this exception is typically only raised if a module is not available.
-        # in this case the test should be skipped
-        py.test.skip(str(e))
-    key = config.getkey()
-    try:
-        return _SPACECACHE[key]
-    except KeyError:
-        if getattr(option, 'runappdirect', None):
-            if name not in (None, 'std'):
-                myname = getattr(sys, 'pypy_objspaceclass', '')
-                if not myname.lower().startswith(name):
-                    py.test.skip("cannot runappdirect test: "
-                                 "%s objspace required" % (name,))
-            return TinyObjSpace(**kwds)
-        space = maketestobjspace(config)
-        _SPACECACHE[key] = space
-        return space
-
-def maketestobjspace(config=None):
-    if config is None:
-        config = make_config(option)
-    space = make_objspace(config)
-    space.startup() # Initialize all builtin modules
-    space.setitem(space.builtin.w_dict, space.wrap('AssertionError'),
-                  appsupport.build_pytest_assertion(space))
-    space.setitem(space.builtin.w_dict, space.wrap('raises'),
-                  space.wrap(appsupport.app_raises))
-    space.setitem(space.builtin.w_dict, space.wrap('skip'),
-                  space.wrap(appsupport.app_skip))
-    space.raises_w = appsupport.raises_w.__get__(space)
-    space.eq_w = appsupport.eq_w.__get__(space)
-    return space
-
-class TinyObjSpace(object):
-    def __init__(self, **kwds):
-        import sys
-        info = getattr(sys, 'pypy_translation_info', None)
-        for key, value in kwds.iteritems():
-            if key == 'usemodules':
-                if info is not None:
-                    for modname in value:
-                        ok = info.get('objspace.usemodules.%s' % modname,
-                                      False)
-                        if not ok:
-                            py.test.skip("cannot runappdirect test: "
-                                         "module %r required" % (modname,))
-                else:
-                    if '__pypy__' in value:
-                        py.test.skip("no module __pypy__ on top of CPython")
-                continue
-            if info is None:
-                py.test.skip("cannot runappdirect this test on top of CPython")
-            has = info.get(key, None)
-            if has != value:
-                #print sys.pypy_translation_info
-                py.test.skip("cannot runappdirect test: space needs %s = %s, "\
-                    "while pypy-c was built with %s" % (key, value, has))
-
-        for name in ('int', 'long', 'str', 'unicode', 'None'):
-            setattr(self, 'w_' + name, eval(name))
-
-
-    def appexec(self, args, body):
-        body = body.lstrip()
-        assert body.startswith('(')
-        src = py.code.Source("def anonymous" + body)
-        d = {}
-        exec src.compile() in d
-        return d['anonymous'](*args)
-
-    def wrap(self, obj):
-        return obj
-
-    def unpackiterable(self, itr):
-        return list(itr)
-
-    def is_true(self, obj):
-        return bool(obj)
-
-    def str_w(self, w_str):
-        return w_str
-
-    def newdict(self, module=None):
-        return {}
-
-    def newtuple(self, iterable):
-        return tuple(iterable)
-
-    def newlist(self, iterable):
-        return list(iterable)
-
-    def call_function(self, func, *args, **kwds):
-        return func(*args, **kwds)
-
-    def call_method(self, obj, name, *args, **kwds):
-        return getattr(obj, name)(*args, **kwds)
-
-    def getattr(self, obj, name):
-        return getattr(obj, name)
-
-    def setattr(self, obj, name, value):
-        setattr(obj, name, value)
-
-    def getbuiltinmodule(self, name):
-        return __import__(name)
-
-    def delslice(self, obj, *args):
-        obj.__delslice__(*args)
-
-    def is_w(self, obj1, obj2):
-        return obj1 is obj2
-
-def translation_test_so_skip_if_appdirect():
-    if option.runappdirect:
-        py.test.skip("translation test, skipped for appdirect")
-
-
-class OpErrKeyboardInterrupt(KeyboardInterrupt):
-    pass
-
-def check_keyboard_interrupt(e):
-    # we cannot easily convert w_KeyboardInterrupt to KeyboardInterrupt
-    # in general without a space -- here is an approximation
-    try:
-        if e.w_type.name == 'KeyboardInterrupt':
-            tb = sys.exc_info()[2]
-            raise OpErrKeyboardInterrupt, OpErrKeyboardInterrupt(), tb
-    except AttributeError:
-        pass
 
 #
 # Interfacing/Integrating with py.test's collection process
     def makeitem(self, name, obj):
         if isclass(obj) and self.classnamefilter(name):
             if name.startswith('AppTest'):
+                from pypy.tool.pytest.apptest import AppClassCollector
                 return AppClassCollector(name, parent=self)
             elif name.startswith('ExpectTest'):
                 if self.config.option.rundirect:
                     return py.test.collect.Class(name, parent=self)
+                from pypy.tool.pytest.expecttest import ExpectClassCollector
                 return ExpectClassCollector(name, parent=self)
             # XXX todo
             #elif name.startswith('AppExpectTest'):
             #        return AppClassCollector(name, parent=self)
             #    return AppExpectClassCollector(name, parent=self)
             else:
+                from pypy.tool.pytest.inttest import IntClassCollector
                 return IntClassCollector(name, parent=self)
 
         elif hasattr(obj, 'func_code') and self.funcnamefilter(name):
             if name.startswith('app_test_'):
                 assert not obj.func_code.co_flags & 32, \
                     "generator app level functions? you must be joking"
+                from pypy.tool.pytest.apptest import AppTestFunction
                 return AppTestFunction(name, parent=self)
             elif obj.func_code.co_flags & 32: # generator function
                 return pytest.Generator(name, parent=self)
             else:
+                from pypy.tool.pytest.inttest import IntTestFunction
                 return IntTestFunction(name, parent=self)
 
 def skip_on_missing_buildoption(**ropts):
 
 class LazyObjSpaceGetter(object):
     def __get__(self, obj, cls=None):
+        from pypy.tool.pytest.objspace import gettestobjspace
         space = gettestobjspace()
         if cls:
             cls.space = space
         return space
 
 
-class AppError(Exception):
-
-    def __init__(self, excinfo):
-        self.excinfo = excinfo
-
 def pytest_runtest_setup(__multicall__, item):
     if isinstance(item, py.test.collect.Function):
         appclass = item.getparent(PyPyClassCollector)
         if appclass is not None:
+            # Make cls.space and cls.runappdirect available in tests.
             spaceconfig = getattr(appclass.obj, 'spaceconfig', None)
-            if spaceconfig:
+            if spaceconfig is not None:
+                from pypy.tool.pytest.objspace import gettestobjspace
                 appclass.obj.space = gettestobjspace(**spaceconfig)
+            appclass.obj.runappdirect = option.runappdirect
 
     __multicall__.execute()
 
-    if isinstance(item, py.test.collect.Function):
-        if not getattr(item.obj, 'dont_track_allocations', False):
-            leakfinder.start_tracking_allocations()
-
-def pytest_runtest_call(__multicall__, item):
-    __multicall__.execute()
-    item._success = True
-
 def pytest_runtest_teardown(__multicall__, item):
     __multicall__.execute()
 
-    if isinstance(item, py.test.collect.Function):
-        if (not getattr(item.obj, 'dont_track_allocations', False)
-            and leakfinder.TRACK_ALLOCATIONS):
-            item._pypytest_leaks = leakfinder.stop_tracking_allocations(False)
-        else:            # stop_tracking_allocations() already called
-            item._pypytest_leaks = None
-
-        # check for leaks, but only if the test passed so far
-        if getattr(item, '_success', False) and item._pypytest_leaks:
-            raise leakfinder.MallocMismatch(item._pypytest_leaks)
-
     if 'pygame' in sys.modules:
         assert option.view, ("should not invoke Pygame "
                              "if conftest.option.view is False")
 
-_pygame_imported = False
-
-class IntTestFunction(py.test.collect.Function):
-    def __init__(self, *args, **kwargs):
-        super(IntTestFunction, self).__init__(*args, **kwargs)
-        self.keywords['interplevel'] = True
-
-    def runtest(self):
-        try:
-            super(IntTestFunction, self).runtest()
-        except OperationError, e:
-            check_keyboard_interrupt(e)
-            raise
-        except Exception, e:
-            cls = e.__class__
-            while cls is not Exception:
-                if cls.__name__ == 'DistutilsPlatformError':
-                    from distutils.errors import DistutilsPlatformError
-                    if isinstance(e, DistutilsPlatformError):
-                        py.test.skip('%s: %s' % (e.__class__.__name__, e))
-                cls = cls.__bases__[0]
-            raise
-
-class AppTestFunction(py.test.collect.Function):
-    def __init__(self, *args, **kwargs):
-        super(AppTestFunction, self).__init__(*args, **kwargs)
-        self.keywords['applevel'] = True
-
-    def _prunetraceback(self, traceback):
-        return traceback
-
-    def execute_appex(self, space, target, *args):
-        try:
-            target(*args)
-        except OperationError, e:
-            tb = sys.exc_info()[2]
-            if e.match(space, space.w_KeyboardInterrupt):
-                raise OpErrKeyboardInterrupt, OpErrKeyboardInterrupt(), tb
-            appexcinfo = appsupport.AppExceptionInfo(space, e)
-            if appexcinfo.traceback:
-                raise AppError, AppError(appexcinfo), tb
-            raise
-
-    def runtest(self):
-        target = self.obj
-        if self.config.option.runappdirect:
-            return target()
-        space = gettestobjspace()
-        filename = self._getdynfilename(target)
-        func = app2interp_temp(target, filename=filename)
-        print "executing", func
-        self.execute_appex(space, func, space)
-
-    def repr_failure(self, excinfo):
-        if excinfo.errisinstance(AppError):
-            excinfo = excinfo.value.excinfo
-        return super(AppTestFunction, self).repr_failure(excinfo)
-
-    def _getdynfilename(self, func):
-        code = getattr(func, 'im_func', func).func_code
-        return "[%s:%s]" % (code.co_filename, code.co_firstlineno)
-
-class AppTestMethod(AppTestFunction):
-    def setup(self):
-        super(AppTestMethod, self).setup()
-        instance = self.parent.obj
-        w_instance = self.parent.w_instance
-        space = instance.space
-        for name in dir(instance):
-            if name.startswith('w_'):
-                if self.config.option.runappdirect:
-                    setattr(instance, name[2:], getattr(instance, name))
-                else:
-                    obj = getattr(instance, name)
-                    if isinstance(obj, types.MethodType):
-                        source = py.std.inspect.getsource(obj).lstrip()
-                        w_func = space.appexec([], textwrap.dedent("""
-                        ():
-                            %s
-                            return %s
-                        """) % (source, name))
-                        w_obj = Method(space, w_func, w_instance, space.w_None)
-                    else:
-                        w_obj = obj
-                    space.setattr(w_instance, space.wrap(name[2:]), w_obj)
-
-    def runtest(self):
-        target = self.obj
-        if self.config.option.runappdirect:
-            return target()
-        space = target.im_self.space
-        filename = self._getdynfilename(target)
-        func = app2interp_temp(target.im_func, filename=filename)
-        w_instance = self.parent.w_instance
-        self.execute_appex(space, func, space, w_instance)
 
 class PyPyClassCollector(py.test.collect.Class):
+    # All pypy Test classes have a "space" member.
     def setup(self):
         cls = self.obj
         if not hasattr(cls, 'spaceconfig'):
             assert hasattr(cls, 'space') # set by pytest_runtest_setup
         super(PyPyClassCollector, self).setup()
 
-class IntInstanceCollector(py.test.collect.Instance):
-    Function = IntTestFunction
-
-class IntClassCollector(PyPyClassCollector):
-    Instance = IntInstanceCollector
-
-    def _haskeyword(self, keyword):
-        return keyword == 'interplevel' or \
-               super(IntClassCollector, self)._haskeyword(keyword)
-
-    def _keywords(self):
-        return super(IntClassCollector, self)._keywords() + ['interplevel']
-
-class AppClassInstance(py.test.collect.Instance):
-    Function = AppTestMethod
-
-    def setup(self):
-        super(AppClassInstance, self).setup()
-        instance = self.obj
-        space = instance.space
-        w_class = self.parent.w_class
-        if self.config.option.runappdirect:
-            self.w_instance = instance
-        else:
-            self.w_instance = space.call_function(w_class)
-
-class AppClassCollector(PyPyClassCollector):
-    Instance = AppClassInstance
-
-    def _haskeyword(self, keyword):
-        return keyword == 'applevel' or \
-               super(AppClassCollector, self)._haskeyword(keyword)
-
-    def _keywords(self):
-        return super(AppClassCollector, self)._keywords() + ['applevel']
-
-    def setup(self):
-        super(AppClassCollector, self).setup()
-        cls = self.obj
-        #
-        # <hack>
-        for name in dir(cls):
-            if name.startswith('test_'):
-                func = getattr(cls, name, None)
-                code = getattr(func, 'func_code', None)
-                if code and code.co_flags & 32:
-                    raise AssertionError("unsupported: %r is a generator "
-                                         "app-level test method" % (name,))
-        # </hack>
-        #
-        space = cls.space
-        clsname = cls.__name__
-        if self.config.option.runappdirect:
-            w_class = cls
-        else:
-            w_class = space.call_function(space.w_type,
-                                          space.wrap(clsname),
-                                          space.newtuple([]),
-                                          space.newdict())
-        self.w_class = w_class
-
-class ExpectTestMethod(py.test.collect.Function):
-    def safe_name(target):
-        s = "_".join(target)
-        s = s.replace("()", "paren")
-        s = s.replace(".py", "")
-        s = s.replace(".", "_")
-        s = s.replace(os.sep, "_")
-        return s
-
-    safe_name = staticmethod(safe_name)
-
-    def safe_filename(self):
-        name = self.safe_name(self.listnames())
-        num = 0
-        while udir.join(name + '.py').check():
-            num += 1
-            name = self.safe_name(self.listnames()) + "_" + str(num)
-        return name + '.py'
-
-    def _spawn(self, *args, **kwds):
-        import pexpect
-        kwds.setdefault('timeout', 600)
-        child = pexpect.spawn(*args, **kwds)
-        child.logfile = sys.stdout
-        return child
-
-    def spawn(self, argv):
-        return self._spawn(sys.executable, argv)
-
-    def runtest(self):
-        target = self.obj
-        import pexpect
-        source = py.code.Source(target)[1:].deindent()
-        filename = self.safe_filename()
-        source.lines = ['import sys',
-                      'sys.path.insert(0, %s)' % repr(os.path.dirname(pypydir))
-                        ] + source.lines
-        source.lines.append('print "%s ok!"' % filename)
-        f = udir.join(filename)
-        f.write(source)
-        # run target in the guarded environment
-        child = self.spawn([str(f)])
-        import re
-        child.expect(re.escape(filename + " ok!"))
-
-class ExpectClassInstance(py.test.collect.Instance):
-    Function = ExpectTestMethod
-
-class ExpectClassCollector(py.test.collect.Class):
-    Instance = ExpectClassInstance
-
-    def setup(self):
-        super(ExpectClassCollector, self).setup()
-        try:
-            import pexpect
-        except ImportError:
-            py.test.skip("pexpect not found")
-
 
 def pytest_ignore_collect(path):
     return path.check(link=1)

File pypy/doc/conf.py

 # built documents.
 #
 # The short X.Y version.
-version = '1.9'
+version = '2.0'
 # The full version, including alpha/beta/rc tags.
-release = '1.9'
+release = '2.0-beta1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File pypy/doc/getting-started-python.rst

 executable. The executable behaves mostly like a normal Python interpreter::
 
     $ ./pypy-c
-    Python 2.7.2 (341e1e3821ff, Jun 07 2012, 15:40:31)
-    [PyPy 1.9.0 with GCC 4.4.3] on linux2
+    Python 2.7.3 (7e4f0faa3d51, Nov 22 2012, 10:35:18)
+    [PyPy 2.0.0-beta1 with GCC 4.7.1] on linux2
     Type "help", "copyright", "credits" or "license" for more information.
     And now for something completely different: ``RPython magically makes you rich
     and famous (says so on the tin)''
 the ``bin/pypy`` executable.
 
 To install PyPy system wide on unix-like systems, it is recommended to put the
-whole hierarchy alone (e.g. in ``/opt/pypy1.9``) and put a symlink to the
+whole hierarchy alone (e.g. in ``/opt/pypy2.0-beta1``) and put a symlink to the
 ``pypy`` executable into ``/usr/bin`` or ``/usr/local/bin``
 
 If the executable fails to find suitable libraries, it will report

File pypy/doc/getting-started.rst

 PyPy is ready to be executed as soon as you unpack the tarball or the zip
 file, with no need to install it in any specific location::
 
-    $ tar xf pypy-1.9-linux.tar.bz2
-    $ ./pypy-1.9/bin/pypy
-    Python 2.7.2 (341e1e3821ff, Jun 07 2012, 15:40:31)
-    [PyPy 1.9.0 with GCC 4.4.3] on linux2
+    $ tar xf pypy-2.0-beta1-linux.tar.bz2
+    $ ./pypy-2.0-beta1/bin/pypy
+    Python 2.7.3 (7e4f0faa3d51, Nov 22 2012, 10:35:18)
+    [PyPy 2.0.0-beta1 with GCC 4.7.1] on linux2
     Type "help", "copyright", "credits" or "license" for more information.
-    And now for something completely different: ``it seems to me that once you
-    settle on an execution / object model and / or bytecode format, you've already
-    decided what languages (where the 's' seems superfluous) support is going to be
-    first class for''
+    And now for something completely different: ``PyPy is an exciting technology
+    that lets you to write fast, portable, multi-platform interpreters with less
+    effort''
     >>>>
 
 If you want to make PyPy available system-wide, you can put a symlink to the
 
     $ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
 
-    $ ./pypy-1.9/bin/pypy distribute_setup.py
+    $ ./pypy-2.0-beta1/bin/pypy distribute_setup.py
 
-    $ ./pypy-1.9/bin/pypy get-pip.py
+    $ ./pypy-2.0-beta1/bin/pypy get-pip.py
 
-    $ ./pypy-1.9/bin/pip install pygments  # for example
+    $ ./pypy-2.0-beta1/bin/pip install pygments  # for example
 
-3rd party libraries will be installed in ``pypy-1.9/site-packages``, and
-the scripts in ``pypy-1.9/bin``.
+3rd party libraries will be installed in ``pypy-2.0-beta1/site-packages``, and
+the scripts in ``pypy-2.0-beta1/bin``.
 
 Installing using virtualenv
 ---------------------------

File pypy/doc/index.rst

 
 * `FAQ`_: some frequently asked questions.
 
-* `Release 1.9`_: the latest official release
+* `Release 2.0 beta 1`_: the latest official release
 
 * `PyPy Blog`_: news and status info about PyPy 
 
 .. _`Getting Started`: getting-started.html
 .. _`Papers`: extradoc.html
 .. _`Videos`: video-index.html
-.. _`Release 1.9`: http://pypy.org/download.html
+.. _`Release 2.0 beta 1`: http://pypy.org/download.html
 .. _`speed.pypy.org`: http://speed.pypy.org
 .. _`RPython toolchain`: translation.html
 .. _`potential project ideas`: project-ideas.html
 Windows, on top of .NET, and on top of Java.
 To dig into PyPy it is recommended to try out the current
 Mercurial default branch, which is always working or mostly working,
-instead of the latest release, which is `1.9`__.
+instead of the latest release, which is `2.0 beta1`__.
 
-.. __: release-1.9.0.html
+.. __: release-2.0.0-beta1.html
 
 PyPy is mainly developed on Linux and Mac OS X.  Windows is supported,
 but platform-specific bugs tend to take longer before we notice and fix

File pypy/doc/jit-hooks.rst

 understanding what's pypy's JIT doing while running your program. There
 are three functions related to that coming from the `pypyjit` module:
 
-* `set_optimize_hook`::
+* `set_optimize_hook(callable)`::
 
     Set a compiling hook that will be called each time a loop is optimized,
-    but before assembler compilation. This allows to add additional
+    but before assembler compilation. This allows adding additional
     optimizations on Python level.
-    
-    The hook will be called with the following signature:
-    hook(jitdriver_name, loop_type, greenkey or guard_number, operations)
 
-    jitdriver_name is the name of this particular jitdriver, 'pypyjit' is
-    the main interpreter loop
+    The callable will be called with the pypyjit.JitLoopInfo object.
+    Refer to it's documentation for details.
 
-    loop_type can be either `loop` `entry_bridge` or `bridge`
-    in case loop is not `bridge`, greenkey will be a tuple of constants
-    or a string describing it.
+    Result value will be the resulting list of operations, or None
 
-    for the interpreter loop` it'll be a tuple
-    (code, offset, is_being_profiled)
+
+* `set_compile_hook(callable)`::
+
+    Set a compiling hook that will be called each time a loop is compiled.
+
+    The callable will be called with the pypyjit.JitLoopInfo object.
+    Refer to it's documentation for details.
 
     Note that jit hook is not reentrant. It means that if the code
     inside the jit hook is itself jitted, it will get compiled, but the
     jit hook won't be called for that.
 
-    Result value will be the resulting list of operations, or None
-
-* `set_compile_hook`::
-
-    Set a compiling hook that will be called each time a loop is compiled.
-    The hook will be called with the following signature:
-    hook(jitdriver_name, loop_type, greenkey or guard_number, operations,
-         assembler_addr, assembler_length)
-
-    jitdriver_name is the name of this particular jitdriver, 'pypyjit' is
-    the main interpreter loop
-
-    loop_type can be either `loop` `entry_bridge` or `bridge`
-    in case loop is not `bridge`, greenkey will be a tuple of constants
-    or a string describing it.
-
-    for the interpreter loop` it'll be a tuple
-    (code, offset, is_being_profiled)
-
-    assembler_addr is an integer describing where assembler starts,
-    can be accessed via ctypes, assembler_lenght is the lenght of compiled
-    asm
-
-    Note that jit hook is not reentrant. It means that if the code
-    inside the jit hook is itself jitted, it will get compiled, but the
-    jit hook won't be called for that.
-
-* `set_abort_hook`::
+* `set_abort_hook(hook)`::
 
     Set a hook (callable) that will be called each time there is tracing
     aborted due to some reason.
 
     The hook will be called as in: hook(jitdriver_name, greenkey, reason)
 
-    Where reason is the reason for abort, see documentation for set_compile_hook
-    for descriptions of other arguments.
+    Reason is a string, the meaning of other arguments is the same
+    as attributes on JitLoopInfo object
+

File pypy/doc/project-ideas.rst

 PyPy's bytearray type is very inefficient. It would be an interesting
 task to look into possible optimizations on this.
 
+Implement copy-on-write list slicing
+------------------------------------
+
+The idea is to have a special implementation of list objects which is used
+when doing ``myslice = mylist[a:b]``: the new list is not constructed
+immediately, but only when (and if) ``myslice`` or ``mylist`` are mutated.
+
+
 Numpy improvements
 ------------------
 

File pypy/doc/release-2.0.0-beta1.rst

+===============
+PyPy 2.0 beta 1
+===============
+
+We're pleased to announce the 2.0 beta 1 release of PyPy. This release is
+not a typical beta, in a sense the stability is the same or better than 1.9
+and can be used in production. It does however include a few performance
+regressions documented below that don't allow us to label is as 2.0 final.
+(It also contains many performance improvements.)
+
+The main features of this release are support for ARM processor and
+compatibility with CFFI. It also includes
+numerous improvements to the numpy in pypy effort, cpyext and performance.
+
+You can download the PyPy 2.0 beta 1 release here:
+
+    http://pypy.org/download.html 
+
+What is PyPy?
+=============
+
+PyPy is a very compliant Python interpreter, almost a drop-in replacement for
+CPython 2.7.3. It's fast (`pypy 2.0 beta 1 and cpython 2.7.3`_
+performance comparison) due to its integrated tracing JIT compiler.
+
+This release supports x86 machines running Linux 32/64, Mac OS X 64 or
+Windows 32. It also supports ARM machines running Linux.
+Windows 64 work is still stalling, we would welcome a volunteer
+to handle that.
+
+.. _`pypy 2.0 beta 1 and cpython 2.7.3`: http://bit.ly/USXqpP
+
+How to use PyPy?
+================
+
+We suggest using PyPy from a `virtualenv`_. Once you have a virtualenv
+installed, you can follow instructions from `pypy documentation`_ on how
+to proceed. This document also covers other `installation schemes`_.
+
+.. _`pypy documentation`: http://doc.pypy.org/en/latest/getting-started.html#installing-using-virtualenv
+.. _`virtualenv`: http://www.virtualenv.org/en/latest/
+.. _`installation schemes`: http://doc.pypy.org/en/latest/getting-started.html#installing-pypy
+.. _`PyPy and pip`: http://doc.pypy.org/en/latest/getting-started.html#installing-pypy
+
+Regressions
+===========
+
+Reasons why this is not PyPy 2.0:
+
+* the ``ctypes`` fast path is now slower than it used to be. In PyPy
+  1.9 ``ctypes`` was either incredibly faster or slower than CPython depending whether
+  you hit the fast path or not. Right now it's usually simply slower. We're
+  probably going to rewrite ``ctypes`` using ``cffi``, which will make it
+  universally faster.
+
+* ``cffi`` (an alternative to interfacing with C code) is very fast, but
+  it is missing one optimization that will make it as fast as a native
+  call from C.
+
+* ``numpypy`` lazy computation was disabled for the sake of simplicity.
+  We should reenable this for the final 2.0 release.
+
+Highlights
+==========
+
+* ``cffi`` is officially supported by PyPy. You can install it normally by
+  using ``pip install cffi`` once you have installed `PyPy and pip`_.
+  The corresponding ``0.4`` version of ``cffi`` has been released.
+
+* ARM is now an officially supported processor architecture.
+  PyPy now work on soft-float ARM/Linux builds.  Currently ARM processors
+  supporting the ARMv7 and later ISA that include a floating-point unit are
+  supported.
+
+* This release contains the latest Python standard library 2.7.3 and is fully
+  compatible with Python 2.7.3.
+
+* It does not however contain hash randomization, since the solution present
+  in CPython is not solving the problem anyway. The reason can be
+  found on the `CPython issue tracker`_.
+
+* ``gc.get_referrers()`` is now faster.
+
+* Various numpy improvements. The list includes:
+
+  * axis argument support in many places
+
+  * full support for fancy indexing
+
+  * ``complex128`` and ``complex64`` dtypes
+
+* `JIT hooks`_ are now a powerful tool to introspect the JITting process that
+  PyPy performs.
+
+* ``**kwds`` usage is much faster in the typical scenario
+
+* operations on ``long`` objects are now as fast as in CPython (from
+  roughly 2x slower)
+
+* We now have special strategies for ``dict``/``set``/``list`` which contain
+  unicode strings, which means that now such collections will be both faster
+  and more compact.
+
+.. _`cpython issue tracker`: http://bugs.python.org/issue14621
+.. _`jit hooks`: http://doc.pypy.org/en/latest/jit-hooks.html
+
+Things we're working on
+=======================
+
+There are a few things that did not make it to the 2.0 beta 1, which
+are being actively worked on. Greenlets support in the JIT is one
+that we would like to have before 2.0 final. Two important items that
+will not make it to 2.0, but are being actively worked on, are:
+
+* Faster JIT warmup time.
+
+* Software Transactional Memory.
+
+Cheers,
+Maciej Fijalkowski, Armin Rigo and the PyPy team

File pypy/doc/sandbox.rst

 this case we also generate systematic run-time checks against buffer
 overflows.
 
+.. warning::
+  
+  The hard work from the PyPy side is done --- you get a fully secure
+  version.  What is only experimental and unpolished is the library to
+  use this sandboxed PyPy from a regular Python interpreter (CPython, or
+  an unsandboxed PyPy).  Contributions welcome.
+
 
 Overview
 --------

File pypy/doc/translation.rst

     .. image:: image/translation-greyscale-small.png
 
 
-.. _`PDF color version`: image/translation.pdf
+.. _`PDF color version`: https://bitbucket.org/pypy/pypy/raw/default/pypy/doc/image/translation.pdf
 .. _`bytecode evaluator`: interpreter.html
 .. _`abstract interpretation`: http://en.wikipedia.org/wiki/Abstract_interpretation
 .. _`Flow Object Space`: objspace.html#the-flow-object-space

File pypy/doc/whatsnew-2.0.0-beta1.rst

+======================
+What's new in PyPy xxx
+======================
+
+.. this is the revision of the last merge from default to release-1.9.x
+.. startrev: 8d567513d04d
+
+Fixed the performance of gc.get_referrers()
+
+.. branch: default
+.. branch: app_main-refactor
+.. branch: win-ordinal
+.. branch: reflex-support
+Provides cppyy module (disabled by default) for access to C++ through Reflex.
+See doc/cppyy.rst for full details and functionality.
+.. branch: nupypy-axis-arg-check
+Check that axis arg is valid in _numpypy
+.. branch:less-gettestobjspace
+.. branch: move-apptest-support
+
+.. branch: iterator-in-rpython
+.. branch: numpypy_count_nonzero
+.. branch: numpy-refactor
+Remove numpy lazy evaluation and simplify everything
+.. branch: numpy-reintroduce-jit-drivers
+.. branch: numpy-fancy-indexing
+Support for array[array-of-ints] in numpy
+.. branch: even-more-jit-hooks
+Implement better JIT hooks
+.. branch: virtual-arguments
+Improve handling of **kwds greatly, making them virtual sometimes.
+.. branch: improve-rbigint
+Introduce __int128 on systems where it's supported and improve the speed of
+rlib/rbigint.py greatly.
+.. branch: translation-cleanup
+Start to clean up a bit the flow object space.
+.. branch: ffi-backend
+Support CFFI.  http://morepypy.blogspot.ch/2012/08/cffi-release-03.html
+.. branch: speedup-unpackiterable
+.. branch: stdlib-2.7.3
+The stdlib was updated to version 2.7.3
+
+.. branch: numpypy-complex2
+Complex dtype support for numpy
+.. branch: numpypy-problems
+Improve dtypes intp, uintp, void, string and record
+.. branch: numpypy.float16
+Add float16 numpy dtype
+.. branch: kill-someobject
+major cleanups including killing some object support
+.. branch: cpyext-PyThreadState_New
+implement threadstate-related functions in cpyext
+
+.. branch: unicode-strategies
+add dict/list/set strategies optimized for unicode items
+
+.. "uninteresting" branches that we should just ignore for the whatsnew:
+.. branch: slightly-shorter-c
+.. branch: better-enforceargs
+.. branch: rpython-unicode-formatting
+.. branch: jit-opaque-licm
+.. branch: rpython-utf8
+Support for utf-8 encoding in RPython
+.. branch: arm-backend-2
+Support ARM in the JIT.

File pypy/doc/whatsnew-head.rst

 What's new in PyPy xxx
 ======================
 
-.. this is the revision of the last merge from default to release-1.9.x
-.. startrev: 8d567513d04d
+.. this is a revision shortly after release-2.0-beta1
+.. startrev: 0e6161a009c6
 
-.. branch: default
-.. branch: app_main-refactor
-.. branch: win-ordinal
-.. branch: reflex-support
-Provides cppyy module (disabled by default) for access to C++ through Reflex.
-See doc/cppyy.rst for full details and functionality.
-.. branch: nupypy-axis-arg-check
-Check that axis arg is valid in _numpypy
+.. branch: autoreds
+XXX
 
-.. branch: iterator-in-rpython
-.. branch: numpypy_count_nonzero
-.. branch: numpy-refactor
-Remove numpy lazy evaluation and simplify everything
-.. branch: numpy-reintroduce-jit-drivers
-.. branch: numpy-fancy-indexing
-Support for array[array-of-ints] in numpy
-.. branch: even-more-jit-hooks
-Implement better JIT hooks
-.. branch: virtual-arguments
-Improve handling of **kwds greatly, making them virtual sometimes.
-.. branch: improve-rbigint
-Introduce __int128 on systems where it's supported and improve the speed of
-rlib/rbigint.py greatly.
-.. branch: translation-cleanup
-Start to clean up a bit the flow object space.
-.. branch: ffi-backend
-Support CFFI.  http://morepypy.blogspot.ch/2012/08/cffi-release-03.html
-.. branch: speedup-unpackiterable
-.. branch: stdlib-2.7.3
-The stdlib was updated to version 2.7.3
-
-.. branch: numpypy-complex2
-Complex dtype support for numpy
-.. branch: numpypy-problems
-Improve dtypes intp, uintp, void, string and record
-.. branch: kill-someobject
-major cleanups including killing some object support
-
-
-.. "uninteresting" branches that we should just ignore for the whatsnew:
-.. branch: slightly-shorter-c
-.. branch: better-enforceargs
-.. branch: rpython-unicode-formatting
-.. branch: jit-opaque-licm
-.. branch: rpython-utf8
-Support for utf-8 encoding in RPython
-.. branch: arm-backend-2
-Support ARM in the JIT.
+.. branch: length-hint
+XXX

File pypy/interpreter/argument.py

File contents unchanged.

File pypy/interpreter/astcompiler/optimize.py

 unrolling_unary_folders = unrolling_iterable(unary_folders.items())
 
 for folder in binary_folders.values() + unary_folders.values():
-    folder._always_inline_ = True
+    folder._always_inline_ = 'try'
 del folder
 
 opposite_compare_operations = misc.dict_to_switch({

File pypy/interpreter/baseobjspace.py

         """
         # If we can guess the expected length we can preallocate.
         try:
-            lgt_estimate = self.len_w(w_iterable)
-        except OperationError, o:
-            if (not o.match(self, self.w_AttributeError) and
-                not o.match(self, self.w_TypeError)):
-                raise
-            items = []
-        else:
-            try:
-                items = newlist_hint(lgt_estimate)
-            except MemoryError:
-                items = [] # it might have lied
-        #
+            items = newlist_hint(self.length_hint(w_iterable, 0))
+        except MemoryError:
+            items = [] # it might have lied
+
         tp = self.type(w_iterator)
         while True:
             unpackiterable_driver.jit_merge_point(tp=tp,
         return self._unpackiterable_known_length_jitlook(w_iterator,
                                                          expected_length)
 
+    def length_hint(self, w_obj, default):
+        """Return the length of an object, consulting its __length_hint__
+        method if necessary.
+        """
+        try:
+            return self.len_w(w_obj)
+        except OperationError, e:
+            if not (e.match(self, self.w_TypeError) or
+                    e.match(self, self.w_AttributeError)):
+                raise
+
+        w_descr = self.lookup(w_obj, '__length_hint__')
+        if w_descr is None:
+            return default
+        try:
+            w_hint = self.get_and_call_function(w_descr, w_obj)
+        except OperationError, e:
+            if not (e.match(self, self.w_TypeError) or
+                    e.match(self, self.w_AttributeError)):
+                raise
+            return default
+        if self.is_w(w_hint, self.w_NotImplemented):
+            return default
+
+        hint = self.int_w(w_hint)
+        if hint < 0:
+            raise OperationError(self.w_ValueError, self.wrap(
+                    "__length_hint__() should return >= 0"))
+        return hint
+
     def fixedview(self, w_iterable, expected_length=-1):
         """ A fixed list view of w_iterable. Don't modify the result
         """
         """
         return None
 
+    def listview_unicode(self, w_list):
+        """ Return a list of unwrapped unicode out of a list of unicode. If the
+        argument is not a list or does not contain only unicode, return None.
+        May return None anyway.
+        """
+        return None
+
     def view_as_kwargs(self, w_dict):
         """ if w_dict is a kwargs-dict, return two lists, one of unwrapped
         strings and one of wrapped values. otherwise return (None, None)
     def newlist_str(self, list_s):
         return self.newlist([self.wrap(s) for s in list_s])
 
+    def newlist_hint(self, sizehint):
+        from pypy.objspace.std.listobject import make_empty_list_with_size
+        return make_empty_list_with_size(self, sizehint)
+
     @jit.unroll_safe
     def exception_match(self, w_exc_type, w_check_class):
         """Checks if the given exception type matches 'w_check_class'."""

File pypy/interpreter/buffer.py

         if not isinstance(self, RWBuffer):
             raise OperationError(space.w_TypeError,
                                  space.wrap("buffer is read-only"))
-        start, stop, step = space.decode_index(w_index, self.getlength())
+        start, stop, step, size = space.decode_index4(w_index, self.getlength())
         if step == 0:  # index only
             if len(newstring) != 1:
                 msg = 'buffer[index]=x: x must be a single character'
             char = newstring[0]   # annotator hint
             self.setitem(start, char)
         elif step == 1:
-            length = stop - start
-            if length != len(newstring):
-                if length < 0 and len(newstring) == 0:
-                    pass     # ok anyway
-                else:
-                    msg = "right operand length must match slice length"
-                    raise OperationError(space.w_ValueError, space.wrap(msg))
+            if len(newstring) != size:
+                msg = "right operand length must match slice length"
+                raise OperationError(space.w_ValueError, space.wrap(msg))
             self.setslice(start, newstring)
         else:
             raise OperationError(space.w_ValueError,

File pypy/interpreter/error.py

             raise operationerrfmt(space.w_TypeError, msg, typename)
         return w_type
 
-    def write_unraisable(self, space, where, w_object=None):
+    def write_unraisable(self, space, where, w_object=None,
+                         with_traceback=False, extra_line=''):
         if w_object is None:
             objrepr = ''
         else:
                 objrepr = space.str_w(space.repr(w_object))
             except OperationError:
                 objrepr = '?'
-        msg = 'Exception %s in %s%s ignored\n' % (
-            self.errorstr(space, use_repr=True), where, objrepr)
+        #
         try:
-            space.call_method(space.sys.get('stderr'), 'write', space.wrap(msg))
+            if with_traceback:
+                w_t = self.w_type
+                w_v = self.get_w_value(space)
+                w_tb = space.wrap(self.get_traceback())
+                space.appexec([space.wrap(where),
+                               space.wrap(objrepr),
+                               space.wrap(extra_line),
+                               w_t, w_v, w_tb],
+                """(where, objrepr, extra_line, t, v, tb):
+                    import sys, traceback
+                    sys.stderr.write('From %s%s:\\n' % (where, objrepr))
+                    if extra_line:
+                        sys.stderr.write(extra_line)
+                    traceback.print_exception(t, v, tb)
+                """)
+            else:
+                msg = 'Exception %s in %s%s ignored\n' % (
+                    self.errorstr(space, use_repr=True), where, objrepr)
+                space.call_method(space.sys.get('stderr'), 'write',
+                                  space.wrap(msg))
         except OperationError:
             pass   # ignored
 

File pypy/interpreter/executioncontext.py

         actionflag = self.space.actionflag
         if actionflag.get_ticker() < 0:
             actionflag.action_dispatcher(self, frame)     # slow path
-    bytecode_trace_after_exception._always_inline_ = True
+    bytecode_trace_after_exception._always_inline_ = 'try'
+    # NB. this function is not inlined right now.  backendopt.inline would
+    # need some improvements to handle this case, but it's not really an
+    # issue
 
     def exception_trace(self, frame, operationerr):
         "Trace function called upon OperationError."

File pypy/interpreter/nestedscope.py

     def MAKE_CLOSURE(self, numdefaults, next_instr):
         w_codeobj = self.popvalue()
         codeobj = self.space.interp_w(pycode.PyCode, w_codeobj)
-        if codeobj.magic >= 0xa0df281:    # CPython 2.5 AST branch merge
-            w_freevarstuple = self.popvalue()
-            freevars = [self.space.interp_w(Cell, cell)
-                        for cell in self.space.fixedview(w_freevarstuple)]
-        else:
-            n = len(codeobj.co_freevars)
-            freevars = [None] * n
-            while True:
-                n -= 1
-                if n < 0:
-                    break
-                freevars[n] = self.space.interp_w(Cell, self.popvalue())
+        w_freevarstuple = self.popvalue()
+        freevars = [self.space.interp_w(Cell, cell)
+                    for cell in self.space.fixedview(w_freevarstuple)]
         defaultarguments = self.popvalues(numdefaults)
         fn = function.Function(self.space, codeobj, self.w_globals,
                                defaultarguments, freevars)

File pypy/interpreter/pyframe.py

File contents unchanged.

File pypy/interpreter/test/test_appinterp.py

         per-instance attribute, holding a fresh copy of the dictionary.
         """
         from pypy.interpreter.mixedmodule import MixedModule
-        from pypy.conftest import maketestobjspace
+        from pypy.tool.pytest.objspace import maketestobjspace
 
         class MyModule(MixedModule):
             interpleveldefs = {}
         w_str = space1.getattr(w_mymod1, space1.wrap("hi"))
         assert space1.str_w(w_str) == "hello"
 
+class TestMixedModuleUnfreeze:
+    spaceconfig = dict(usemodules=('_ssl', '_socket'))
+
     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
         # This is important when the module startup() function does something
         # at runtime, like setting os.environ (posix module) or initializing
         # the winsock library (_socket module)
-        from pypy.conftest import gettestobjspace
-        space = gettestobjspace(usemodules=('_ssl', '_socket'))
-
-        w_socket = space.builtin_modules['_socket']
-        w_ssl = space.builtin_modules['_ssl']
+        w_socket = self.space.builtin_modules['_socket']
+        w_ssl = self.space.builtin_modules['_ssl']
 
         # Uncomment this line for a workaround
         # space.getattr(w_ssl, space.wrap('SSLError'))

File pypy/interpreter/test/test_argument.py

File contents unchanged.

File pypy/interpreter/test/test_code.py

-from pypy.conftest import gettestobjspace
 from pypy.interpreter import gateway
 from pypy.interpreter.astcompiler import consts
 import py
 
 class AppTestCodeIntrospection:
     def setup_class(cls):
-        space = gettestobjspace()
-        cls.space = space
         filename = __file__
         if filename[-3:] != '.py':
             filename = filename[:-1]
 
-        cls.w_file = space.wrap(filename)
-        cls.w_CO_CONTAINSGLOBALS = space.wrap(consts.CO_CONTAINSGLOBALS)
+        cls.w_file = cls.space.wrap(filename)
+        cls.w_CO_CONTAINSGLOBALS = cls.space.wrap(consts.CO_CONTAINSGLOBALS)
 
     def test_attributes(self):
         def f(): pass

File pypy/interpreter/test/test_compiler.py

 from pypy.interpreter.pycode import PyCode
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.argument import Arguments
-from pypy.conftest import gettestobjspace
 
 class BaseTestCompiler:
     def setup_method(self, method):
         assert "LOAD_GLOBAL" not in output
 
 class AppTestCallMethod(object):
-    def setup_class(cls):
-        cls.space = gettestobjspace(**{'objspace.opcodes.CALL_METHOD': True})
+    spaceconfig = {'objspace.opcodes.CALL_METHOD': True}
         
     def test_call_method_kwargs(self):
         source = """def _f(a):

File pypy/interpreter/test/test_executioncontext.py

 import py
 from pypy.interpreter import executioncontext
-from pypy.conftest import gettestobjspace, option
 
 class Finished(Exception):
     pass
 
 
 class TestExecutionContext:
-    keywords = {}
-
-    def setup_class(cls):
-        cls.space = gettestobjspace(**cls.keywords)
-
     def test_action(self):
 
         class DemoAction(executioncontext.AsyncAction):
 
 
 class TestExecutionContextWithCallMethod(TestExecutionContext):
-    keywords = {'objspace.opcodes.CALL_METHOD': True}
+    spaceconfig ={'objspace.opcodes.CALL_METHOD': True}
 
 
 class AppTestDelNotBlocked:
 
     def setup_method(self, meth):
-        if not option.runappdirect:
+        if not self.runappdirect:
             py.test.skip("test is meant for running with py.test -A")
         from pypy.tool.udir import udir
         tmpfile = udir.join('test_execution_context')

File pypy/interpreter/test/test_gateway.py

 
 # -*- coding: utf-8 -*-
 
-from pypy.conftest import gettestobjspace
 from pypy.interpreter import gateway, argument
 from pypy.interpreter.gateway import ObjSpace, W_Root, WrappedDefault
 import py
         assert isinstance(called[0], argument.Arguments)
 
 class TestPassThroughArguments_CALL_METHOD(TestPassThroughArguments):
-
-    def setup_class(cls):
-        space = gettestobjspace(usemodules=('itertools',), **{
+    spaceconfig = dict(usemodules=('itertools',), **{
             "objspace.opcodes.CALL_METHOD": True
             })
-        cls.space = space
 
 class AppTestKeywordsToBuiltinSanity(object):
 

File pypy/interpreter/test/test_syntax.py

 from __future__ import with_statement
 import py
-from pypy.conftest import gettestobjspace
 
 def splitcases(s):
     lines = [line.rstrip() for line in s.split('\n')]

File pypy/interpreter/test/test_zzpickle_and_slow.py

 import py
 from pypy import conftest