Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3k
Changeset: r59366:b402af2e511e
Date: 2012-12-07 16:23 -0800
http://bitbucket.org/pypy/pypy/changeset/b402af2e511e/

Log:    merge default

diff --git a/pypy/annotation/signature.py b/pypy/annotation/signature.py
--- a/pypy/annotation/signature.py
+++ b/pypy/annotation/signature.py
@@ -132,7 +132,7 @@
         inputcells[:] = args_s
 
 def finish_type(paramtype, bookkeeper, func):
-    from pypy.annotation.types import SelfTypeMarker
+    from pypy.rlib.types import SelfTypeMarker
     if isinstance(paramtype, SomeObject):
         return paramtype
     elif isinstance(paramtype, SelfTypeMarker):
diff --git a/pypy/annotation/types.py b/pypy/annotation/types.py
deleted file mode 100644
--- a/pypy/annotation/types.py
+++ /dev/null
@@ -1,60 +0,0 @@
-from pypy.annotation import model
-from pypy.annotation.listdef import ListDef
-from pypy.annotation.dictdef import DictDef
-
-
-def none():
-    return model.s_None
-
-
-def float():
-    return model.SomeFloat()
-
-def singlefloat():
-    return model.SomeSingleFloat()
-
-def longfloat():
-    return model.SomeLongFloat()
-
-
-def int():
-    return model.SomeInteger()
-
-
-def unicode():
-    return model.SomeUnicodeString()
-
-def unicode0():
-    return model.SomeUnicodeString(no_nul=True)
-
-def str():
-    return model.SomeString()
-
-def str0():
-    return model.SomeString(no_nul=True)
-
-def char():
-    return model.SomeChar()
-
-
-def list(element):
-    listdef = ListDef(None, element, mutated=True, resized=True)
-    return model.SomeList(listdef)
-
-def array(element):
-    listdef = ListDef(None, element, mutated=True, resized=False)
-    return model.SomeList(listdef)
-
-def dict(keytype, valuetype):
-    dictdef = DictDef(None, keytype, valuetype)
-    return model.SomeDict(dictdef)
-
-
-def instance(class_):
-    return lambda bookkeeper: 
model.SomeInstance(bookkeeper.getuniqueclassdef(class_))
-
-class SelfTypeMarker(object):
-    pass
-
-def self():
-    return SelfTypeMarker()
diff --git a/pypy/module/posix/test/test_posix2.py 
b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -13,11 +13,13 @@
 import signal
 
 def setup_module(mod):
+    usemodules = ['binascii', 'posix', 'struct', 'rctime']
     if os.name != 'nt':
-        mod.space = gettestobjspace(usemodules=['posix', 'fcntl', 'struct', 
'signal'])
+        usemodules += ['fcntl']
     else:
         # On windows, os.popen uses the subprocess module
-        mod.space = gettestobjspace(usemodules=['posix', '_rawffi', 'thread', 
'struct', 'signal'])
+        usemodules += ['_rawffi', 'thread']
+    mod.space = gettestobjspace(usemodules=usemodules)
     mod.path = udir.join('posixtestfile.txt')
     mod.path.write("this is a test")
     mod.path2 = udir.join('test_posix2-')
@@ -52,9 +54,6 @@
 
 
 class AppTestPosix:
-    spaceconfig = {
-        "usemodules": ["binascii", "struct", "rctime"],
-    }
 
     def setup_class(cls):
         cls.space = space
diff --git a/pypy/rlib/objectmodel.py b/pypy/rlib/objectmodel.py
--- a/pypy/rlib/objectmodel.py
+++ b/pypy/rlib/objectmodel.py
@@ -3,6 +3,8 @@
 RPython-compliant way.
 """
 
+from __future__ import absolute_import
+
 import py
 import sys
 import types
diff --git a/pypy/rlib/rgc.py b/pypy/rlib/rgc.py
--- a/pypy/rlib/rgc.py
+++ b/pypy/rlib/rgc.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
 import gc
 import types
 
diff --git a/pypy/rlib/signature.py b/pypy/rlib/signature.py
--- a/pypy/rlib/signature.py
+++ b/pypy/rlib/signature.py
@@ -1,4 +1,4 @@
-from pypy.annotation import types
+from pypy.rlib import types
 
 def signature(*paramtypes, **kwargs):
     """Decorate a function to specify its type signature.
diff --git a/pypy/rlib/test/test_objectmodel.py 
b/pypy/rlib/test/test_objectmodel.py
--- a/pypy/rlib/test/test_objectmodel.py
+++ b/pypy/rlib/test/test_objectmodel.py
@@ -1,6 +1,7 @@
 import py
 from pypy.rlib.objectmodel import *
-from pypy.annotation import types, model
+from pypy.rlib import types
+from pypy.annotation import model
 from pypy.translator.translator import TranslationContext, graphof
 from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
 from pypy.rpython.test.test_llinterp import interpret
diff --git a/pypy/rlib/test/test_signature.py b/pypy/rlib/test/test_signature.py
--- a/pypy/rlib/test/test_signature.py
+++ b/pypy/rlib/test/test_signature.py
@@ -1,6 +1,7 @@
 import py
 from pypy.rlib.signature import signature, finishsigs
-from pypy.annotation import types, model
+from pypy.rlib import types
+from pypy.annotation import model
 from pypy.translator.translator import TranslationContext, graphof
 
 
diff --git a/pypy/rlib/types.py b/pypy/rlib/types.py
new file mode 100644
--- /dev/null
+++ b/pypy/rlib/types.py
@@ -0,0 +1,54 @@
+from pypy.annotation import model
+from pypy.annotation.listdef import ListDef
+from pypy.annotation.dictdef import DictDef
+
+
+def none():
+    return model.s_None
+
+
+def float():
+    return model.SomeFloat()
+
+def singlefloat():
+    return model.SomeSingleFloat()
+
+def longfloat():
+    return model.SomeLongFloat()
+
+
+def int():
+    return model.SomeInteger()
+
+
+def unicode():
+    return model.SomeUnicodeString()
+
+def str():
+    return model.SomeString()
+
+def char():
+    return model.SomeChar()
+
+
+def list(element):
+    listdef = ListDef(None, element, mutated=True, resized=True)
+    return model.SomeList(listdef)
+
+def array(element):
+    listdef = ListDef(None, element, mutated=True, resized=False)
+    return model.SomeList(listdef)
+
+def dict(keytype, valuetype):
+    dictdef = DictDef(None, keytype, valuetype)
+    return model.SomeDict(dictdef)
+
+
+def instance(class_):
+    return lambda bookkeeper: 
model.SomeInstance(bookkeeper.getuniqueclassdef(class_))
+
+class SelfTypeMarker(object):
+    pass
+
+def self():
+    return SelfTypeMarker()
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to