Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r59215:6fb576a37671
Date: 2012-12-02 09:35 -0800
http://bitbucket.org/pypy/pypy/changeset/6fb576a37671/
Log: fix config tests
diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -134,14 +134,6 @@
default=False),
]),
- BoolOption("nofaking", "disallow faking in the object space",
- default=False,
- requires=[
- ("objspace.usemodules.posix", True),
- ("objspace.usemodules.time", True),
- ("objspace.usemodules.errno", True)],
- cmdline='--nofaking'),
-
OptionDescription("usemodules", "Which Modules should be used", [
BoolOption(modname, "use module %s" % (modname, ),
default=modname in default_modules,
diff --git a/pypy/config/test/test_config.py b/pypy/config/test/test_config.py
--- a/pypy/config/test/test_config.py
+++ b/pypy/config/test/test_config.py
@@ -64,7 +64,6 @@
assert '_cfgimpl_values' in attrs # from self
if sys.version_info >= (2, 6):
assert 'gc' in attrs # custom attribute
- assert 'objspace' in attrs # custom attribute
#
attrs = dir(config.gc)
if sys.version_info >= (2, 6):
@@ -262,14 +261,14 @@
config = Config(descr)
assert config.getpaths() == ['gc.name', 'gc.dummy', 'gc.float', 'bool',
- 'objspace', 'wantref', 'str', 'wantframework',
+ 'wantref', 'str', 'wantframework',
'int']
assert config.getpaths() == descr.getpaths()
assert config.gc.getpaths() == ['name', 'dummy', 'float']
assert config.gc.getpaths() == descr.gc.getpaths()
assert config.getpaths(include_groups=True) == [
'gc', 'gc.name', 'gc.dummy', 'gc.float',
- 'bool', 'objspace', 'wantref', 'str', 'wantframework', 'int']
+ 'bool', 'wantref', 'str', 'wantframework', 'int']
assert config.getpaths(True) == descr.getpaths(True)
def test_underscore_in_option_name():
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -450,11 +450,6 @@
if 'rctime' in modules and 'time' in modules:
modules.remove('time')
- if not self.config.objspace.nofaking:
- for modname in self.ALL_BUILTIN_MODULES:
- if not LIB_PYPY.join(modname+'.py').check(file=True):
- modules.append('faked+'+modname)
-
self._builtinmodule_list = modules
return self._builtinmodule_list
diff --git a/pypy/jit/tl/pypyjit.py b/pypy/jit/tl/pypyjit.py
--- a/pypy/jit/tl/pypyjit.py
+++ b/pypy/jit/tl/pypyjit.py
@@ -32,7 +32,6 @@
config = get_pypy_config(translating=True)
config.translation.backendopt.inline_threshold = 0.1
config.translation.gc = 'boehm'
-config.objspace.nofaking = True
config.translating = True
set_opt_level(config, level='jit')
config.objspace.allworkingmodules = False
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -127,13 +127,6 @@
ec._py_repr = None
return ec
- def createframe(self, code, w_globals, outer_func=None):
- from pypy.objspace.std.fake import CPythonFakeCode, CPythonFakeFrame
- if not we_are_translated() and isinstance(code, CPythonFakeCode):
- return CPythonFakeFrame(self, code, w_globals)
- else:
- return ObjSpace.createframe(self, code, w_globals, outer_func)
-
def gettypefor(self, cls):
return self.gettypeobject(cls.typedef)
@@ -236,10 +229,6 @@
# '__builtin__.Ellipsis' avoids confusion with special.Ellipsis
return self.w_Ellipsis
- if self.config.objspace.nofaking:
- raise OperationError(self.w_RuntimeError,
- self.wrap("nofaking enabled: refusing "
- "to wrap cpython value %r" %(x,)))
if isinstance(x, type(Exception)) and issubclass(x, Exception):
w_result = self.wrap_exception_cls(x)
if w_result is not None:
diff --git a/pypy/objspace/std/test/test_complexobject.py
b/pypy/objspace/std/test/test_complexobject.py
--- a/pypy/objspace/std/test/test_complexobject.py
+++ b/pypy/objspace/std/test/test_complexobject.py
@@ -9,7 +9,6 @@
EPS = 1e-9
class TestW_ComplexObject:
-
def test_instantiation(self):
def _t_complex(r=0.0,i=0.0):
c = W_ComplexObject(r, i)
@@ -84,6 +83,8 @@
class AppTestAppComplexTest:
+ spaceconfig = dict(usemodules=['binascii', 'rctime'])
+
def w_check_div(self, x, y):
"""Compute complex z=x*y, and check that z/x==y and z/y==x."""
z = x * y
diff --git a/pypy/objspace/std/test/test_floatobject.py
b/pypy/objspace/std/test/test_floatobject.py
--- a/pypy/objspace/std/test/test_floatobject.py
+++ b/pypy/objspace/std/test/test_floatobject.py
@@ -60,6 +60,8 @@
class AppTestAppFloatTest:
+ spaceconfig = dict(usemodules=['binascii', 'rctime'])
+
def setup_class(cls):
cls.w_py26 = cls.space.wrap(sys.version_info >= (2, 6))
@@ -450,6 +452,8 @@
assert False, 'did not raise'
class AppTestFloatHex:
+ spaceconfig = dict(usemodules=['binascii', 'rctime'])
+
def w_identical(self, x, y):
import math
# check that floats x and y are identical, or that both
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
@@ -192,7 +192,6 @@
config.objspace.lonepycfiles = False
config.objspace.usepycfiles = False
- config.objspace.nofaking = True
config.translating = True
import translate
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit