[pypy-commit] pypy split-rpython: Initial package rename:

Aquana noreply at buildbot.pypy.org
Fri Jan 4 22:30:50 CET 2013


Author: Alexander Hesse <webmaster at aquanasoft.de>
Branch: split-rpython
Changeset: r59695:f86b274daa88
Date: 2012-12-30 21:54 +0100
http://bitbucket.org/pypy/pypy/changeset/f86b274daa88/

Log:	Initial package rename: pypy.rpython -> rpython.rtyper
	pypy.translator -> rpython.translator pypy.rlib -> rpython.rlib
	pypy.jit -> rpython.jit pypy.objspace.flow -> rpython.flowspace
	pypy.annotation -> rpython.annotator

diff too long, truncating to 2000 out of 38413 lines

diff --git a/dotviewer/test/test_translator.py b/dotviewer/test/test_translator.py
--- a/dotviewer/test/test_translator.py
+++ b/dotviewer/test/test_translator.py
@@ -21,7 +21,7 @@
 
 
 def test_annotated():
-    from pypy.translator.interactive import Translation
+    from rpython.translator.interactive import Translation
     t = Translation(is_prime)
     t.annotate([int])
     t.viewcg()
diff --git a/lib_pypy/ctypes_config_cache/dumpcache.py b/lib_pypy/ctypes_config_cache/dumpcache.py
--- a/lib_pypy/ctypes_config_cache/dumpcache.py
+++ b/lib_pypy/ctypes_config_cache/dumpcache.py
@@ -1,6 +1,6 @@
 import os
 from ctypes_configure import dumpcache
-from pypy.jit.backend import detect_cpu
+from rpython.jit.backend import detect_cpu
 
 def dumpcache2(basename, config):
     model = detect_cpu.autodetect_main_model_and_size()
@@ -14,7 +14,7 @@
 try:
     from __pypy__ import cpumodel
 except ImportError:
-    from pypy.jit.backend import detect_cpu
+    from rpython.jit.backend import detect_cpu
     cpumodel = detect_cpu.autodetect_main_model_and_size()
 # XXX relative import, should be removed together with
 # XXX the relative imports done e.g. by lib_pypy/pypy_test/test_hashlib
diff --git a/lib_pypy/ctypes_config_cache/rebuild.py b/lib_pypy/ctypes_config_cache/rebuild.py
--- a/lib_pypy/ctypes_config_cache/rebuild.py
+++ b/lib_pypy/ctypes_config_cache/rebuild.py
@@ -31,7 +31,7 @@
         sys.path[:] = path
 
 def try_rebuild():
-    from pypy.jit.backend import detect_cpu
+    from rpython.jit.backend import detect_cpu
     model = detect_cpu.autodetect_main_model_and_size()
     # remove the files '_*_model_.py'
     left = {}
diff --git a/pypy/bin/py.py b/pypy/bin/py.py
--- a/pypy/bin/py.py
+++ b/pypy/bin/py.py
@@ -57,7 +57,7 @@
 
 
 def set_compiler(option, opt, value, parser):
-    from pypy.translator.platform import set_platform
+    from rpython.translator.platform import set_platform
     set_platform('host', value)
 
 def main_(argv=None):
diff --git a/pypy/bin/reportstaticdata.py b/pypy/bin/reportstaticdata.py
--- a/pypy/bin/reportstaticdata.py
+++ b/pypy/bin/reportstaticdata.py
@@ -28,7 +28,7 @@
 """
 
 import autopath
-from pypy.translator.tool.staticsizereport import print_report
+from rpython.translator.tool.staticsizereport import print_report
 
 def parse_options(argv):
     kwds = {}
diff --git a/pypy/bin/translatorshell.py b/pypy/bin/translatorshell.py
--- a/pypy/bin/translatorshell.py
+++ b/pypy/bin/translatorshell.py
@@ -24,9 +24,9 @@
 """
 
 import autopath, os, sys
-from pypy.translator.interactive import Translation
-from pypy.rpython.rtyper import *
-from pypy.rlib.rarithmetic import *
+from rpython.translator.interactive import Translation
+from rpython.rtyper.rtyper import *
+from rpython.rlib.rarithmetic import *
 
 import py
 
@@ -53,8 +53,8 @@
         setup_readline()
     except ImportError, err:
         print "Disabling readline support (%s)" % err
-    from pypy.translator.test import snippet
-    from pypy.rpython.rtyper import RPythonTyper
+    from rpython.translator.test import snippet
+    from rpython.rtyper.rtyper import RPythonTyper
 
     if (os.getcwd() not in sys.path and
         os.path.curdir not in sys.path):
diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -93,25 +93,25 @@
 }
 
 module_import_dependencies = {
-    # no _rawffi if importing pypy.rlib.clibffi raises ImportError
+    # no _rawffi if importing rpython.rlib.clibffi raises ImportError
     # or CompilationError or py.test.skip.Exception
-    "_rawffi"   : ["pypy.rlib.clibffi"],
-    "_ffi"      : ["pypy.rlib.clibffi"],
+    "_rawffi"   : ["rpython.rlib.clibffi"],
+    "_ffi"      : ["rpython.rlib.clibffi"],
 
-    "zlib"      : ["pypy.rlib.rzlib"],
+    "zlib"      : ["rpython.rlib.rzlib"],
     "bz2"       : ["pypy.module.bz2.interp_bz2"],
     "pyexpat"   : ["pypy.module.pyexpat.interp_pyexpat"],
     "_ssl"      : ["pypy.module._ssl.interp_ssl"],
     "_hashlib"  : ["pypy.module._ssl.interp_ssl"],
     "_minimal_curses": ["pypy.module._minimal_curses.fficurses"],
-    "_continuation": ["pypy.rlib.rstacklet"],
+    "_continuation": ["rpython.rlib.rstacklet"],
     }
 
 def get_module_validator(modname):
     if modname in module_import_dependencies:
         modlist = module_import_dependencies[modname]
         def validator(config):
-            from pypy.rpython.tool.rffi_platform import CompilationError
+            from rpython.rtyper.tool.rffi_platform import CompilationError
             try:
                 for name in modlist:
                     __import__(name)
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
@@ -90,7 +90,7 @@
     assert c1.a == [1]
 
 def test_annotator_folding():
-    from pypy.translator.interactive import Translation
+    from rpython.translator.interactive import Translation
 
     gcoption = ChoiceOption('name', 'GC name', ['ref', 'framework'], 'ref')
     gcgroup = OptionDescription('gc', '', [gcoption])
diff --git a/pypy/config/translationoption.py b/pypy/config/translationoption.py
--- a/pypy/config/translationoption.py
+++ b/pypy/config/translationoption.py
@@ -198,7 +198,7 @@
                   default=DEFL_INLINE_THRESHOLD, cmdline="--inline-threshold"),
         StrOption("inline_heuristic", "Dotted name of an heuristic function "
                   "for inlining",
-                default="pypy.translator.backendopt.inline.inlining_heuristic",
+                default="rpython.translator.backendopt.inline.inlining_heuristic",
                 cmdline="--inline-heuristic"),
 
         BoolOption("print_statistics", "Print statistics while optimizing",
@@ -226,7 +226,7 @@
         StrOption("profile_based_inline_heuristic",
                   "Dotted name of an heuristic function "
                   "for profile based inlining",
-                default="pypy.translator.backendopt.inline.inlining_heuristic",
+                default="rpython.translator.backendopt.inline.inlining_heuristic",
                 ),  # cmdline="--prof-based-inline-heuristic" fix me
         # control clever malloc removal
         BoolOption("clever_malloc_removal",
@@ -241,7 +241,7 @@
         StrOption("clever_malloc_removal_heuristic",
                   "Dotted name of an heuristic function "
                   "for inlining in clever malloc removal",
-                default="pypy.translator.backendopt.inline.inlining_heuristic",
+                default="rpython.translator.backendopt.inline.inlining_heuristic",
                 cmdline="--clever-malloc-removal-heuristic"),
 
         BoolOption("remove_asserts",
@@ -339,7 +339,7 @@
 def final_check_config(config):
     # XXX: this should be a real config option, but it is hard to refactor it;
     # instead, we "just" patch it from here
-    from pypy.rlib import rfloat
+    from rpython.rlib import rfloat
     if config.translation.type_system == 'ootype':
         rfloat.USE_SHORT_FLOAT_REPR = False
 
@@ -393,11 +393,11 @@
 # ----------------------------------------------------------------
 
 def set_platform(config):
-    from pypy.translator.platform import set_platform
+    from rpython.translator.platform import set_platform
     set_platform(config.translation.platform, config.translation.cc)
 
 def get_platform(config):
-    from pypy.translator.platform import pick_platform
+    from rpython.translator.platform import pick_platform
     opt = config.translation.platform
     cc = config.translation.cc
     return pick_platform(opt, cc)
diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -36,7 +36,7 @@
 
 def _set_platform(opt, opt_str, value, parser):
     from pypy.config.translationoption import PLATFORMS
-    from pypy.translator.platform import set_platform
+    from rpython.translator.platform import set_platform
     if value not in PLATFORMS:
         raise ValueError("%s not in %s" % (value, PLATFORMS))
     set_platform(value, None)
diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py
--- a/pypy/interpreter/argument.py
+++ b/pypy/interpreter/argument.py
@@ -3,8 +3,8 @@
 """
 
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rlib.debug import make_sure_not_resized
-from pypy.rlib import jit
+from rpython.rlib.debug import make_sure_not_resized
+from rpython.rlib import jit
 
 
 class Signature(object):
diff --git a/pypy/interpreter/astcompiler/assemble.py b/pypy/interpreter/astcompiler/assemble.py
--- a/pypy/interpreter/astcompiler/assemble.py
+++ b/pypy/interpreter/astcompiler/assemble.py
@@ -7,8 +7,8 @@
 from pypy.tool import stdlib_opcode as ops
 
 from pypy.interpreter.error import OperationError
-from pypy.rlib.objectmodel import we_are_translated
-from pypy.rlib import rfloat
+from rpython.rlib.objectmodel import we_are_translated
+from rpython.rlib import rfloat
 
 
 class Instruction(object):
diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py
--- a/pypy/interpreter/astcompiler/ast.py
+++ b/pypy/interpreter/astcompiler/ast.py
@@ -3,7 +3,7 @@
 from pypy.interpreter import typedef
 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rlib.unroll import unrolling_iterable
+from rpython.rlib.unroll import unrolling_iterable
 from pypy.tool.pairtype import extendabletype
 from pypy.tool.sourcetools import func_with_new_name
 
diff --git a/pypy/interpreter/astcompiler/astbuilder.py b/pypy/interpreter/astcompiler/astbuilder.py
--- a/pypy/interpreter/astcompiler/astbuilder.py
+++ b/pypy/interpreter/astcompiler/astbuilder.py
@@ -4,7 +4,7 @@
 from pypy.interpreter.pyparser.pygram import syms, tokens
 from pypy.interpreter.pyparser.error import SyntaxError
 from pypy.interpreter.pyparser import parsestring
-from pypy.rlib.objectmodel import specialize
+from rpython.rlib.objectmodel import specialize
 
 
 def ast_from_node(space, node, compile_info):
diff --git a/pypy/interpreter/astcompiler/misc.py b/pypy/interpreter/astcompiler/misc.py
--- a/pypy/interpreter/astcompiler/misc.py
+++ b/pypy/interpreter/astcompiler/misc.py
@@ -1,7 +1,7 @@
 from pypy.interpreter import gateway
 from pypy.interpreter.astcompiler import ast
-from pypy.rlib.objectmodel import we_are_translated
-from pypy.rlib.unroll import unrolling_iterable
+from rpython.rlib.objectmodel import we_are_translated
+from rpython.rlib.unroll import unrolling_iterable
 
 
 app = gateway.applevel("""
diff --git a/pypy/interpreter/astcompiler/optimize.py b/pypy/interpreter/astcompiler/optimize.py
--- a/pypy/interpreter/astcompiler/optimize.py
+++ b/pypy/interpreter/astcompiler/optimize.py
@@ -4,8 +4,8 @@
 from pypy.interpreter.astcompiler import ast, consts, misc
 from pypy.tool import stdlib_opcode as ops
 from pypy.interpreter.error import OperationError
-from pypy.rlib.unroll import unrolling_iterable
-from pypy.rlib.runicode import MAXUNICODE
+from rpython.rlib.unroll import unrolling_iterable
+from rpython.rlib.runicode import MAXUNICODE
 
 
 def optimize_ast(space, tree, compile_info):
diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py b/pypy/interpreter/astcompiler/tools/asdl_py.py
--- a/pypy/interpreter/astcompiler/tools/asdl_py.py
+++ b/pypy/interpreter/astcompiler/tools/asdl_py.py
@@ -542,7 +542,7 @@
 from pypy.interpreter import typedef
 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rlib.unroll import unrolling_iterable
+from rpython.rlib.unroll import unrolling_iterable
 from pypy.tool.pairtype import extendabletype
 from pypy.tool.sourcetools import func_with_new_name
 
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -8,11 +8,11 @@
 from pypy.interpreter.miscutils import ThreadLocals
 from pypy.tool.cache import Cache
 from pypy.tool.uid import HUGEVAL_BYTES
-from pypy.rlib import jit
-from pypy.rlib.debug import make_sure_not_resized
-from pypy.rlib.objectmodel import we_are_translated, newlist_hint,\
+from rpython.rlib import jit
+from rpython.rlib.debug import make_sure_not_resized
+from rpython.rlib.objectmodel import we_are_translated, newlist_hint,\
      compute_unique_id
-from pypy.rlib.rarithmetic import r_uint
+from rpython.rlib.rarithmetic import r_uint
 
 
 __all__ = ['ObjSpace', 'OperationError', 'Wrappable', 'W_Root']
@@ -1327,7 +1327,7 @@
 
     def str0_w(self, w_obj):
         "Like str_w, but rejects strings with NUL bytes."
-        from pypy.rlib import rstring
+        from rpython.rlib import rstring
         result = w_obj.str_w(self)
         if '\x00' in result:
             raise OperationError(self.w_TypeError, self.wrap(
@@ -1355,7 +1355,7 @@
 
     def unicode0_w(self, w_obj):
         "Like unicode_w, but rejects strings with NUL bytes."
-        from pypy.rlib import rstring
+        from rpython.rlib import rstring
         result = w_obj.unicode_w(self)
         if u'\x00' in result:
             raise OperationError(self.w_TypeError, self.wrap(
@@ -1451,7 +1451,7 @@
         except OperationError, e:
             if not e.match(self, self.w_OverflowError):
                 raise
-            from pypy.rlib.rarithmetic import intmask
+            from rpython.rlib.rarithmetic import intmask
             return intmask(self.bigint_w(w_obj).uintmask())
 
     def truncatedlonglong_w(self, w_obj):
@@ -1462,7 +1462,7 @@
         except OperationError, e:
             if not e.match(self, self.w_OverflowError):
                 raise
-            from pypy.rlib.rarithmetic import longlongmask
+            from rpython.rlib.rarithmetic import longlongmask
             return longlongmask(self.bigint_w(w_obj).ulonglongmask())
 
     def c_filedescriptor_w(self, w_fd):
@@ -1529,7 +1529,7 @@
 
 ## Table describing the regular part of the interface of object spaces,
 ## namely all methods which only take w_ arguments and return a w_ result
-## (if any).  Note: keep in sync with pypy.objspace.flow.operation.Table.
+## (if any).  Note: keep in sync with rpython.flowspace.operation.Table.
 
 ObjSpace.MethodTable = [
 # method name # symbol # number of arguments # special method name(s)
diff --git a/pypy/interpreter/buffer.py b/pypy/interpreter/buffer.py
--- a/pypy/interpreter/buffer.py
+++ b/pypy/interpreter/buffer.py
@@ -19,8 +19,8 @@
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.error import OperationError
-from pypy.rlib.objectmodel import compute_hash
-from pypy.rlib.rstring import StringBuilder
+from rpython.rlib.objectmodel import compute_hash
+from rpython.rlib.rstring import StringBuilder
 
 
 class Buffer(Wrappable):
@@ -155,7 +155,7 @@
     if space.isinstance_w(w_object, space.w_unicode):
         # unicode objects support the old buffer interface
         # but not the new buffer interface (change in python  2.7)
-        from pypy.rlib.rstruct.unichar import pack_unichar, UNICODE_SIZE
+        from rpython.rlib.rstruct.unichar import pack_unichar, UNICODE_SIZE
         unistr = space.unicode_w(w_object)
         builder = StringBuilder(len(unistr) * UNICODE_SIZE)
         for unich in unistr:
diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py
--- a/pypy/interpreter/error.py
+++ b/pypy/interpreter/error.py
@@ -1,6 +1,6 @@
 import os, sys
-from pypy.rlib import jit
-from pypy.rlib.objectmodel import we_are_translated
+from rpython.rlib import jit
+from rpython.rlib.objectmodel import we_are_translated
 from errno import EINTR
 
 AUTO_DEBUG = os.getenv('PYPY_DEBUG')
@@ -324,7 +324,7 @@
     try:
         OpErrFmt = _fmtcache2[formats]
     except KeyError:
-        from pypy.rlib.unroll import unrolling_iterable
+        from rpython.rlib.unroll import unrolling_iterable
         attrs = ['x%d' % i for i in range(len(formats))]
         entries = unrolling_iterable(enumerate(attrs))
         #
@@ -382,7 +382,7 @@
     _WINDOWS = True
 
     def wrap_windowserror(space, e, w_filename=None):
-        from pypy.rlib import rwin32
+        from rpython.rlib import rwin32
 
         winerror = e.winerror
         try:
@@ -440,7 +440,7 @@
 wrap_oserror._annspecialcase_ = 'specialize:arg(3)'
 
 def exception_from_errno(space, w_type):
-    from pypy.rlib.rposix import get_errno
+    from rpython.rlib.rposix import get_errno
 
     errno = get_errno()
     msg = os.strerror(errno)
diff --git a/pypy/interpreter/executioncontext.py b/pypy/interpreter/executioncontext.py
--- a/pypy/interpreter/executioncontext.py
+++ b/pypy/interpreter/executioncontext.py
@@ -1,8 +1,8 @@
 import sys
 from pypy.interpreter.error import OperationError
-from pypy.rlib.rarithmetic import LONG_BIT
-from pypy.rlib.unroll import unrolling_iterable
-from pypy.rlib import jit
+from rpython.rlib.rarithmetic import LONG_BIT
+from rpython.rlib.unroll import unrolling_iterable
+from rpython.rlib import jit
 
 TICK_COUNTER_STEP = 100
 
diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py
--- a/pypy/interpreter/function.py
+++ b/pypy/interpreter/function.py
@@ -6,13 +6,13 @@
 attribute.
 """
 
-from pypy.rlib.unroll import unrolling_iterable
+from rpython.rlib.unroll import unrolling_iterable
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.eval import Code
 from pypy.interpreter.argument import Arguments
-from pypy.rlib import jit
-from pypy.rlib.debug import make_sure_not_resized
+from rpython.rlib import jit
+from rpython.rlib.debug import make_sure_not_resized
 
 funccallunrolling = unrolling_iterable(range(4))
 
diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py
--- a/pypy/interpreter/gateway.py
+++ b/pypy/interpreter/gateway.py
@@ -19,9 +19,9 @@
     SpaceCache, DescrMismatch)
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.function import ClassMethod, FunctionWithFixedCode
-from pypy.rlib import rstackovf
-from pypy.rlib.objectmodel import we_are_translated
-from pypy.rlib.rarithmetic import r_longlong, r_int, r_ulonglong, r_uint
+from rpython.rlib import rstackovf
+from rpython.rlib.objectmodel import we_are_translated
+from rpython.rlib.rarithmetic import r_longlong, r_int, r_ulonglong, r_uint
 from pypy.tool.sourcetools import func_with_new_name, compile2
 
 
diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -1,7 +1,7 @@
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.pyopcode import LoopBlock
-from pypy.rlib import jit
+from rpython.rlib import jit
 
 
 class GeneratorIterator(Wrappable):
diff --git a/pypy/interpreter/module.py b/pypy/interpreter/module.py
--- a/pypy/interpreter/module.py
+++ b/pypy/interpreter/module.py
@@ -4,7 +4,7 @@
 
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.error import OperationError
-from pypy.rlib.objectmodel import we_are_translated
+from rpython.rlib.objectmodel import we_are_translated
 
 class Module(Wrappable):
     """A module."""
diff --git a/pypy/interpreter/nestedscope.py b/pypy/interpreter/nestedscope.py
--- a/pypy/interpreter/nestedscope.py
+++ b/pypy/interpreter/nestedscope.py
@@ -3,7 +3,7 @@
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.mixedmodule import MixedModule
 from pypy.interpreter.astcompiler import consts
-from pypy.rlib import jit
+from rpython.rlib import jit
 from pypy.tool.uid import uid
 
 class Cell(Wrappable):
diff --git a/pypy/interpreter/pycode.py b/pypy/interpreter/pycode.py
--- a/pypy/interpreter/pycode.py
+++ b/pypy/interpreter/pycode.py
@@ -13,10 +13,10 @@
 from pypy.interpreter.astcompiler.consts import (
     CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS, CO_NESTED,
     CO_GENERATOR, CO_CONTAINSGLOBALS)
-from pypy.rlib.rarithmetic import intmask
-from pypy.rlib.debug import make_sure_not_resized
-from pypy.rlib import jit
-from pypy.rlib.objectmodel import compute_hash
+from rpython.rlib.rarithmetic import intmask
+from rpython.rlib.debug import make_sure_not_resized
+from rpython.rlib import jit
+from rpython.rlib.objectmodel import compute_hash
 from pypy.tool.stdlib_opcode import opcodedesc, HAVE_ARGUMENT
 
 
diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py
--- a/pypy/interpreter/pyframe.py
+++ b/pypy/interpreter/pyframe.py
@@ -7,11 +7,11 @@
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.executioncontext import ExecutionContext
 from pypy.interpreter import pytraceback
-from pypy.rlib.objectmodel import we_are_translated, instantiate
-from pypy.rlib.jit import hint
-from pypy.rlib.debug import make_sure_not_resized, check_nonneg
-from pypy.rlib.rarithmetic import intmask, r_uint
-from pypy.rlib import jit
+from rpython.rlib.objectmodel import we_are_translated, instantiate
+from rpython.rlib.jit import hint
+from rpython.rlib.debug import make_sure_not_resized, check_nonneg
+from rpython.rlib.rarithmetic import intmask, r_uint
+from rpython.rlib import jit
 from pypy.tool import stdlib_opcode
 from pypy.tool.stdlib_opcode import host_bytecode_spec
 
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -10,11 +10,11 @@
 from pypy.interpreter import gateway, function, eval, pyframe, pytraceback
 from pypy.interpreter.pycode import PyCode, BytecodeCorruption
 from pypy.tool.sourcetools import func_with_new_name
-from pypy.rlib.objectmodel import we_are_translated
-from pypy.rlib import jit, rstackovf
-from pypy.rlib.rarithmetic import r_uint, intmask
-from pypy.rlib.unroll import unrolling_iterable
-from pypy.rlib.debug import check_nonneg
+from rpython.rlib.objectmodel import we_are_translated
+from rpython.rlib import jit, rstackovf
+from rpython.rlib.rarithmetic import r_uint, intmask
+from rpython.rlib.unroll import unrolling_iterable
+from rpython.rlib.debug import check_nonneg
 from pypy.tool.stdlib_opcode import (bytecode_spec,
                                      unrolling_all_opcode_descs)
 
diff --git a/pypy/interpreter/pyparser/parsestring.py b/pypy/interpreter/pyparser/parsestring.py
--- a/pypy/interpreter/pyparser/parsestring.py
+++ b/pypy/interpreter/pyparser/parsestring.py
@@ -1,6 +1,6 @@
 from pypy.interpreter.error import OperationError
 from pypy.interpreter import unicodehelper
-from pypy.rlib.rstring import StringBuilder
+from rpython.rlib.rstring import StringBuilder
 
 def parsestr(space, encoding, s, unicode_literal=False):
     """Parses a string or unicode literal, and return a wrapped value.
diff --git a/pypy/interpreter/streamutil.py b/pypy/interpreter/streamutil.py
--- a/pypy/interpreter/streamutil.py
+++ b/pypy/interpreter/streamutil.py
@@ -1,4 +1,4 @@
-from pypy.rlib.streamio import StreamError
+from rpython.rlib.streamio import StreamError
 from pypy.interpreter.error import OperationError, wrap_oserror2
 
 def wrap_streamerror(space, e, w_filename=None):
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
@@ -197,7 +197,7 @@
                        space.call_function, w_app_g, space.wrap(-1))
 
     def test_interp2app_unwrap_spec_c_int(self):
-        from pypy.rlib.rarithmetic import r_longlong
+        from rpython.rlib.rarithmetic import r_longlong
         space = self.space
         w = space.wrap
         def g(space, x):
diff --git a/pypy/interpreter/test/test_objspace.py b/pypy/interpreter/test/test_objspace.py
--- a/pypy/interpreter/test/test_objspace.py
+++ b/pypy/interpreter/test/test_objspace.py
@@ -2,7 +2,7 @@
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.function import Function
 from pypy.interpreter.pycode import PyCode
-from pypy.rlib.rarithmetic import r_longlong, r_ulonglong
+from rpython.rlib.rarithmetic import r_longlong, r_ulonglong
 import sys
 
 # this test isn't so much to test that the objspace interface *works*
diff --git a/pypy/interpreter/test/test_zzpickle_and_slow.py b/pypy/interpreter/test/test_zzpickle_and_slow.py
--- a/pypy/interpreter/test/test_zzpickle_and_slow.py
+++ b/pypy/interpreter/test/test_zzpickle_and_slow.py
@@ -1,7 +1,7 @@
 import py
 from pypy import conftest
 from pypy.interpreter import gateway
-from pypy.rlib.jit import non_virtual_ref, vref_None
+from rpython.rlib.jit import non_virtual_ref, vref_None
 
 class AppTestSlow:    
     spaceconfig = dict(usemodules=['itertools'])
diff --git a/pypy/interpreter/typedef.py b/pypy/interpreter/typedef.py
--- a/pypy/interpreter/typedef.py
+++ b/pypy/interpreter/typedef.py
@@ -9,8 +9,8 @@
 from pypy.interpreter.baseobjspace import Wrappable, DescrMismatch
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.tool.sourcetools import compile2, func_with_new_name
-from pypy.rlib.objectmodel import instantiate, compute_identity_hash, specialize
-from pypy.rlib.jit import promote
+from rpython.rlib.objectmodel import instantiate, compute_identity_hash, specialize
+from rpython.rlib.jit import promote
 
 class TypeDef:
     def __init__(self, __name, __base=None, __total_ordering__=None, **rawdict):
diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py
--- a/pypy/interpreter/unicodehelper.py
+++ b/pypy/interpreter/unicodehelper.py
@@ -1,6 +1,6 @@
 from pypy.interpreter.error import OperationError
-from pypy.rlib.objectmodel import specialize
-from pypy.rlib import runicode
+from rpython.rlib.objectmodel import specialize
+from rpython.rlib import runicode
 from pypy.module._codecs import interp_codecs
 
 @specialize.memo()
diff --git a/pypy/module/__builtin__/abstractinst.py b/pypy/module/__builtin__/abstractinst.py
--- a/pypy/module/__builtin__/abstractinst.py
+++ b/pypy/module/__builtin__/abstractinst.py
@@ -7,7 +7,7 @@
 addition to checking for instances and subtypes in the normal way.
 """
 
-from pypy.rlib import jit
+from rpython.rlib import jit
 from pypy.interpreter.error import OperationError
 from pypy.module.__builtin__.interp_classobj import W_ClassObject
 from pypy.module.__builtin__.interp_classobj import W_InstanceObject
diff --git a/pypy/module/__builtin__/functional.py b/pypy/module/__builtin__/functional.py
--- a/pypy/module/__builtin__/functional.py
+++ b/pypy/module/__builtin__/functional.py
@@ -7,10 +7,10 @@
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.interpreter.typedef import TypeDef
-from pypy.rlib import jit
-from pypy.rlib.objectmodel import specialize
-from pypy.rlib.rarithmetic import r_uint, intmask
-from pypy.rlib.rbigint import rbigint
+from rpython.rlib import jit
+from rpython.rlib.objectmodel import specialize
+from rpython.rlib.rarithmetic import r_uint, intmask
+from rpython.rlib.rbigint import rbigint
 
 
 def get_len_of_range(space, lo, hi, step):
diff --git a/pypy/module/__builtin__/interp_classobj.py b/pypy/module/__builtin__/interp_classobj.py
--- a/pypy/module/__builtin__/interp_classobj.py
+++ b/pypy/module/__builtin__/interp_classobj.py
@@ -4,9 +4,9 @@
 from pypy.interpreter.typedef import TypeDef, make_weakref_descr
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.typedef import GetSetProperty, descr_get_dict, descr_set_dict
-from pypy.rlib.objectmodel import compute_identity_hash
-from pypy.rlib.debug import make_sure_not_resized
-from pypy.rlib import jit
+from rpython.rlib.objectmodel import compute_identity_hash
+from rpython.rlib.debug import make_sure_not_resized
+from rpython.rlib import jit
 
 
 def raise_type_err(space, argument, expected, w_obj):
diff --git a/pypy/module/__builtin__/operation.py b/pypy/module/__builtin__/operation.py
--- a/pypy/module/__builtin__/operation.py
+++ b/pypy/module/__builtin__/operation.py
@@ -5,9 +5,9 @@
 from pypy.interpreter import gateway
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import unwrap_spec, WrappedDefault
-from pypy.rlib.runicode import UNICHR
-from pypy.rlib.rfloat import isnan, isinf, round_double
-from pypy.rlib import rfloat
+from rpython.rlib.runicode import UNICHR
+from rpython.rlib.rfloat import isnan, isinf, round_double
+from rpython.rlib import rfloat
 import __builtin__
 
 def abs(space, w_val):
diff --git a/pypy/module/__pypy__/__init__.py b/pypy/module/__pypy__/__init__.py
--- a/pypy/module/__pypy__/__init__.py
+++ b/pypy/module/__pypy__/__init__.py
@@ -71,6 +71,6 @@
         PYC_MAGIC = get_pyc_magic(self.space)
         self.extra_interpdef('PYC_MAGIC', 'space.wrap(%d)' % PYC_MAGIC)
         #
-        from pypy.jit.backend import detect_cpu
+        from rpython.jit.backend import detect_cpu
         model = detect_cpu.autodetect_main_model_and_size()
         self.extra_interpdef('cpumodel', 'space.wrap(%r)' % model)
diff --git a/pypy/module/__pypy__/interp_builders.py b/pypy/module/__pypy__/interp_builders.py
--- a/pypy/module/__pypy__/interp_builders.py
+++ b/pypy/module/__pypy__/interp_builders.py
@@ -2,7 +2,7 @@
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef
-from pypy.rlib.rstring import UnicodeBuilder, StringBuilder
+from rpython.rlib.rstring import UnicodeBuilder, StringBuilder
 from pypy.tool.sourcetools import func_with_new_name
 
 
diff --git a/pypy/module/__pypy__/interp_debug.py b/pypy/module/__pypy__/interp_debug.py
--- a/pypy/module/__pypy__/interp_debug.py
+++ b/pypy/module/__pypy__/interp_debug.py
@@ -1,5 +1,5 @@
 from pypy.interpreter.gateway import unwrap_spec
-from pypy.rlib import debug, jit
+from rpython.rlib import debug, jit
 
 
 @jit.dont_look_inside
diff --git a/pypy/module/__pypy__/interp_magic.py b/pypy/module/__pypy__/interp_magic.py
--- a/pypy/module/__pypy__/interp_magic.py
+++ b/pypy/module/__pypy__/interp_magic.py
@@ -1,11 +1,11 @@
 from pypy.interpreter.baseobjspace import ObjSpace, W_Root
 from pypy.interpreter.error import OperationError, wrap_oserror
 from pypy.interpreter.gateway import unwrap_spec
-from pypy.rlib.objectmodel import we_are_translated
+from rpython.rlib.objectmodel import we_are_translated
 from pypy.objspace.std.listobject import W_ListObject
 from pypy.objspace.std.typeobject import MethodCache
 from pypy.objspace.std.mapdict import IndexCache
-from pypy.rlib import rposix
+from rpython.rlib import rposix
 
 
 def internal_repr(space, w_object):
@@ -85,7 +85,7 @@
         raise wrap_oserror(space, e)
 
 def get_console_cp(space):
-    from pypy.rlib import rwin32    # Windows only
+    from rpython.rlib import rwin32    # Windows only
     return space.newtuple([
         space.wrap('cp%d' % rwin32.GetConsoleCP()),
         space.wrap('cp%d' % rwin32.GetConsoleOutputCP()),
diff --git a/pypy/module/__pypy__/interp_time.py b/pypy/module/__pypy__/interp_time.py
--- a/pypy/module/__pypy__/interp_time.py
+++ b/pypy/module/__pypy__/interp_time.py
@@ -3,9 +3,9 @@
 
 from pypy.interpreter.error import exception_from_errno
 from pypy.interpreter.gateway import unwrap_spec
-from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rtyper.lltypesystem import rffi, lltype
+from rpython.rtyper.tool import rffi_platform
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 
 if sys.platform == 'linux2':
     libraries = ["rt"]
diff --git a/pypy/module/__pypy__/test/test_debug.py b/pypy/module/__pypy__/test/test_debug.py
--- a/pypy/module/__pypy__/test/test_debug.py
+++ b/pypy/module/__pypy__/test/test_debug.py
@@ -1,7 +1,7 @@
 import py
 
 from pypy.interpreter.gateway import interp2app
-from pypy.rlib import debug
+from rpython.rlib import debug
 
 
 class AppTestDebug:
diff --git a/pypy/module/_cffi_backend/__init__.py b/pypy/module/_cffi_backend/__init__.py
--- a/pypy/module/_cffi_backend/__init__.py
+++ b/pypy/module/_cffi_backend/__init__.py
@@ -1,5 +1,5 @@
 from pypy.interpreter.mixedmodule import MixedModule
-from pypy.rlib import rdynload
+from rpython.rlib import rdynload
 
 
 class Module(MixedModule):
diff --git a/pypy/module/_cffi_backend/cbuffer.py b/pypy/module/_cffi_backend/cbuffer.py
--- a/pypy/module/_cffi_backend/cbuffer.py
+++ b/pypy/module/_cffi_backend/cbuffer.py
@@ -3,7 +3,7 @@
 from pypy.interpreter.buffer import RWBuffer
 from pypy.interpreter.gateway import unwrap_spec, interp2app
 from pypy.interpreter.typedef import TypeDef
-from pypy.rpython.lltypesystem import rffi
+from rpython.rtyper.lltypesystem import rffi
 from pypy.module._cffi_backend import cdataobj, ctypeptr, ctypearray
 
 
diff --git a/pypy/module/_cffi_backend/ccallback.py b/pypy/module/_cffi_backend/ccallback.py
--- a/pypy/module/_cffi_backend/ccallback.py
+++ b/pypy/module/_cffi_backend/ccallback.py
@@ -3,10 +3,10 @@
 """
 import os
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.rlib.objectmodel import compute_unique_id, keepalive_until_here
-from pypy.rlib import clibffi, rweakref, rgc
-from pypy.rlib.rarithmetic import r_ulonglong
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from rpython.rlib.objectmodel import compute_unique_id, keepalive_until_here
+from rpython.rlib import clibffi, rweakref, rgc
+from rpython.rlib.rarithmetic import r_ulonglong
 
 from pypy.module._cffi_backend.cdataobj import W_CData
 from pypy.module._cffi_backend.ctypefunc import SIZE_OF_FFI_ARG, BIG_ENDIAN
diff --git a/pypy/module/_cffi_backend/cdataobj.py b/pypy/module/_cffi_backend/cdataobj.py
--- a/pypy/module/_cffi_backend/cdataobj.py
+++ b/pypy/module/_cffi_backend/cdataobj.py
@@ -3,9 +3,9 @@
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, make_weakref_descr
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.rlib.objectmodel import keepalive_until_here, specialize
-from pypy.rlib import objectmodel, rgc
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rlib.objectmodel import keepalive_until_here, specialize
+from rpython.rlib import objectmodel, rgc
 from pypy.tool.sourcetools import func_with_new_name
 
 from pypy.module._cffi_backend import misc
diff --git a/pypy/module/_cffi_backend/cerrno.py b/pypy/module/_cffi_backend/cerrno.py
--- a/pypy/module/_cffi_backend/cerrno.py
+++ b/pypy/module/_cffi_backend/cerrno.py
@@ -1,11 +1,11 @@
 import sys
-from pypy.rlib import rposix
+from rpython.rlib import rposix
 from pypy.interpreter.executioncontext import ExecutionContext
 from pypy.interpreter.gateway import unwrap_spec
 
 WIN32 = sys.platform == 'win32'
 if WIN32:
-    from pypy.rlib import rwin32
+    from rpython.rlib import rwin32
 
 
 ExecutionContext._cffi_saved_errno = 0
diff --git a/pypy/module/_cffi_backend/ctypearray.py b/pypy/module/_cffi_backend/ctypearray.py
--- a/pypy/module/_cffi_backend/ctypearray.py
+++ b/pypy/module/_cffi_backend/ctypearray.py
@@ -6,9 +6,9 @@
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.typedef import TypeDef
-from pypy.rpython.lltypesystem import rffi
-from pypy.rlib.objectmodel import keepalive_until_here
-from pypy.rlib.rarithmetic import ovfcheck
+from rpython.rtyper.lltypesystem import rffi
+from rpython.rlib.objectmodel import keepalive_until_here
+from rpython.rlib.rarithmetic import ovfcheck
 
 from pypy.module._cffi_backend.ctypeprim import W_CTypePrimitiveChar
 from pypy.module._cffi_backend.ctypeprim import W_CTypePrimitiveUniChar
diff --git a/pypy/module/_cffi_backend/ctypeenum.py b/pypy/module/_cffi_backend/ctypeenum.py
--- a/pypy/module/_cffi_backend/ctypeenum.py
+++ b/pypy/module/_cffi_backend/ctypeenum.py
@@ -3,9 +3,9 @@
 """
 
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rpython.lltypesystem import rffi
-from pypy.rlib.rarithmetic import intmask, r_ulonglong
-from pypy.rlib.objectmodel import keepalive_until_here
+from rpython.rtyper.lltypesystem import rffi
+from rpython.rlib.rarithmetic import intmask, r_ulonglong
+from rpython.rlib.objectmodel import keepalive_until_here
 
 from pypy.module._cffi_backend.ctypeprim import W_CTypePrimitiveSigned
 from pypy.module._cffi_backend import misc
diff --git a/pypy/module/_cffi_backend/ctypefunc.py b/pypy/module/_cffi_backend/ctypefunc.py
--- a/pypy/module/_cffi_backend/ctypefunc.py
+++ b/pypy/module/_cffi_backend/ctypefunc.py
@@ -4,13 +4,13 @@
 
 import sys
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.rlib import jit, clibffi, jit_libffi
-from pypy.rlib.jit_libffi import CIF_DESCRIPTION, CIF_DESCRIPTION_P
-from pypy.rlib.jit_libffi import FFI_TYPE, FFI_TYPE_P, FFI_TYPE_PP
-from pypy.rlib.jit_libffi import SIZE_OF_FFI_ARG
-from pypy.rlib.objectmodel import we_are_translated, instantiate
-from pypy.rlib.objectmodel import keepalive_until_here
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from rpython.rlib import jit, clibffi, jit_libffi
+from rpython.rlib.jit_libffi import CIF_DESCRIPTION, CIF_DESCRIPTION_P
+from rpython.rlib.jit_libffi import FFI_TYPE, FFI_TYPE_P, FFI_TYPE_PP
+from rpython.rlib.jit_libffi import SIZE_OF_FFI_ARG
+from rpython.rlib.objectmodel import we_are_translated, instantiate
+from rpython.rlib.objectmodel import keepalive_until_here
 
 from pypy.module._cffi_backend.ctypeobj import W_CType
 from pypy.module._cffi_backend.ctypeptr import W_CTypePtrBase, W_CTypePointer
diff --git a/pypy/module/_cffi_backend/ctypeobj.py b/pypy/module/_cffi_backend/ctypeobj.py
--- a/pypy/module/_cffi_backend/ctypeobj.py
+++ b/pypy/module/_cffi_backend/ctypeobj.py
@@ -4,8 +4,8 @@
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.typedef import make_weakref_descr
 from pypy.interpreter.typedef import GetSetProperty, interp_attrproperty
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.rlib.objectmodel import we_are_translated
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from rpython.rlib.objectmodel import we_are_translated
 
 from pypy.module._cffi_backend import cdataobj
 
diff --git a/pypy/module/_cffi_backend/ctypeprim.py b/pypy/module/_cffi_backend/ctypeprim.py
--- a/pypy/module/_cffi_backend/ctypeprim.py
+++ b/pypy/module/_cffi_backend/ctypeprim.py
@@ -3,10 +3,10 @@
 """
 
 from pypy.interpreter.error import operationerrfmt
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.rlib.rarithmetic import r_uint, r_ulonglong, intmask
-from pypy.rlib.objectmodel import keepalive_until_here
-from pypy.rlib import jit
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rlib.rarithmetic import r_uint, r_ulonglong, intmask
+from rpython.rlib.objectmodel import keepalive_until_here
+from rpython.rlib import jit
 
 from pypy.module._cffi_backend.ctypeobj import W_CType
 from pypy.module._cffi_backend import cdataobj, misc
diff --git a/pypy/module/_cffi_backend/ctypeptr.py b/pypy/module/_cffi_backend/ctypeptr.py
--- a/pypy/module/_cffi_backend/ctypeptr.py
+++ b/pypy/module/_cffi_backend/ctypeptr.py
@@ -4,10 +4,10 @@
 
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.error import wrap_oserror
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.rlib.objectmodel import keepalive_until_here
-from pypy.rlib.rarithmetic import ovfcheck
-from pypy.rlib import rposix
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rlib.objectmodel import keepalive_until_here
+from rpython.rlib.rarithmetic import ovfcheck
+from rpython.rlib import rposix
 
 from pypy.module._cffi_backend.ctypeobj import W_CType
 from pypy.module._cffi_backend import cdataobj, misc, ctypeprim, ctypevoid
diff --git a/pypy/module/_cffi_backend/ctypestruct.py b/pypy/module/_cffi_backend/ctypestruct.py
--- a/pypy/module/_cffi_backend/ctypestruct.py
+++ b/pypy/module/_cffi_backend/ctypestruct.py
@@ -3,12 +3,12 @@
 """
 
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rpython.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
-from pypy.rlib.objectmodel import keepalive_until_here
-from pypy.rlib.rarithmetic import r_uint, r_ulonglong, r_longlong, intmask
-from pypy.rlib import jit
+from rpython.rlib.objectmodel import keepalive_until_here
+from rpython.rlib.rarithmetic import r_uint, r_ulonglong, r_longlong, intmask
+from rpython.rlib import jit
 
 from pypy.module._cffi_backend.ctypeobj import W_CType
 from pypy.module._cffi_backend import cdataobj, ctypeprim, misc
diff --git a/pypy/module/_cffi_backend/libraryobj.py b/pypy/module/_cffi_backend/libraryobj.py
--- a/pypy/module/_cffi_backend/libraryobj.py
+++ b/pypy/module/_cffi_backend/libraryobj.py
@@ -3,8 +3,8 @@
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.rlib.rdynload import DLLHANDLE, dlopen, dlsym, dlclose, DLOpenError
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rlib.rdynload import DLLHANDLE, dlopen, dlsym, dlclose, DLOpenError
 
 from pypy.module._cffi_backend.cdataobj import W_CData
 from pypy.module._cffi_backend.ctypeobj import W_CType
diff --git a/pypy/module/_cffi_backend/misc.py b/pypy/module/_cffi_backend/misc.py
--- a/pypy/module/_cffi_backend/misc.py
+++ b/pypy/module/_cffi_backend/misc.py
@@ -1,11 +1,11 @@
 from __future__ import with_statement
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.rlib.rarithmetic import r_uint, r_ulonglong, is_signed_integer_type
-from pypy.rlib.unroll import unrolling_iterable
-from pypy.rlib.objectmodel import keepalive_until_here, specialize
-from pypy.rlib import jit
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from rpython.rlib.rarithmetic import r_uint, r_ulonglong, is_signed_integer_type
+from rpython.rlib.unroll import unrolling_iterable
+from rpython.rlib.objectmodel import keepalive_until_here, specialize
+from rpython.rlib import jit
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 
 # ____________________________________________________________
 
diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py
--- a/pypy/module/_cffi_backend/newtype.py
+++ b/pypy/module/_cffi_backend/newtype.py
@@ -1,8 +1,8 @@
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.gateway import unwrap_spec
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.rlib.rarithmetic import ovfcheck
-from pypy.rlib.objectmodel import specialize
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rlib.rarithmetic import ovfcheck
+from rpython.rlib.objectmodel import specialize
 
 from pypy.module._cffi_backend import ctypeobj, ctypeprim, ctypeptr, ctypearray
 from pypy.module._cffi_backend import ctypestruct, ctypevoid, ctypeenum
diff --git a/pypy/module/_cffi_backend/test/test_c.py b/pypy/module/_cffi_backend/test/test_c.py
--- a/pypy/module/_cffi_backend/test/test_c.py
+++ b/pypy/module/_cffi_backend/test/test_c.py
@@ -22,8 +22,8 @@
 from pypy.tool.udir import udir
 from pypy.interpreter import gateway
 from pypy.module._cffi_backend import Module
-from pypy.translator.platform import host
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.translator.platform import host
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 
 
 class AppTestC(object):
diff --git a/pypy/module/_cffi_backend/test/test_ztranslation.py b/pypy/module/_cffi_backend/test/test_ztranslation.py
--- a/pypy/module/_cffi_backend/test/test_ztranslation.py
+++ b/pypy/module/_cffi_backend/test/test_ztranslation.py
@@ -1,6 +1,6 @@
 from pypy.objspace.fake.checkmodule import checkmodule
 from pypy.module._cffi_backend import ctypeptr
-from pypy.rpython.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 
 # side-effect: FORMAT_LONGDOUBLE must be built before test_checkmodule()
 from pypy.module._cffi_backend import misc
diff --git a/pypy/module/_codecs/__init__.py b/pypy/module/_codecs/__init__.py
--- a/pypy/module/_codecs/__init__.py
+++ b/pypy/module/_codecs/__init__.py
@@ -1,5 +1,5 @@
 from pypy.interpreter.mixedmodule import MixedModule
-from pypy.rlib import runicode
+from rpython.rlib import runicode
 from pypy.module._codecs import interp_codecs
 
 class Module(MixedModule):
diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py
--- a/pypy/module/_codecs/interp_codecs.py
+++ b/pypy/module/_codecs/interp_codecs.py
@@ -1,7 +1,7 @@
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
-from pypy.rlib.rstring import UnicodeBuilder
-from pypy.rlib.objectmodel import we_are_translated
+from rpython.rlib.rstring import UnicodeBuilder
+from rpython.rlib.objectmodel import we_are_translated
 
 class CodecState(object):
     def __init__(self, space):
@@ -352,7 +352,7 @@
 # ____________________________________________________________
 # delegation to runicode
 
-from pypy.rlib import runicode
+from rpython.rlib import runicode
 
 def make_encoder_wrapper(name):
     rname = "unicode_encode_%s" % (name.replace("_encode", ""), )
diff --git a/pypy/module/_collections/interp_deque.py b/pypy/module/_collections/interp_deque.py
--- a/pypy/module/_collections/interp_deque.py
+++ b/pypy/module/_collections/interp_deque.py
@@ -5,7 +5,7 @@
 from pypy.interpreter.typedef import GetSetProperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.error import OperationError
-from pypy.rlib.debug import check_nonneg
+from rpython.rlib.debug import check_nonneg
 
 
 # A `dequeobject` is composed of a doubly-linked list of `block` nodes.
diff --git a/pypy/module/_continuation/interp_continuation.py b/pypy/module/_continuation/interp_continuation.py
--- a/pypy/module/_continuation/interp_continuation.py
+++ b/pypy/module/_continuation/interp_continuation.py
@@ -1,5 +1,5 @@
-from pypy.rlib.rstacklet import StackletThread
-from pypy.rlib import jit
+from rpython.rlib.rstacklet import StackletThread
+from rpython.rlib import jit
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.executioncontext import ExecutionContext
 from pypy.interpreter.baseobjspace import Wrappable
@@ -206,7 +206,7 @@
         self.space = space
         self.ec = ec
         # for unpickling
-        from pypy.rlib.rweakref import RWeakKeyDictionary
+        from rpython.rlib.rweakref import RWeakKeyDictionary
         self.frame2continulet = RWeakKeyDictionary(PyFrame, W_Continulet)
 
 ExecutionContext.stacklet_thread = None
diff --git a/pypy/module/_continuation/interp_pickle.py b/pypy/module/_continuation/interp_pickle.py
--- a/pypy/module/_continuation/interp_pickle.py
+++ b/pypy/module/_continuation/interp_pickle.py
@@ -1,5 +1,5 @@
 from pypy.tool import stdlib_opcode as pythonopcode
-from pypy.rlib import jit
+from rpython.rlib import jit
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.pyframe import PyFrame
 from pypy.module._continuation.interp_continuation import State, global_state
diff --git a/pypy/module/_continuation/test/support.py b/pypy/module/_continuation/test/support.py
--- a/pypy/module/_continuation/test/support.py
+++ b/pypy/module/_continuation/test/support.py
@@ -1,5 +1,5 @@
 import py
-from pypy.rpython.tool.rffi_platform import CompilationError
+from rpython.rtyper.tool.rffi_platform import CompilationError
 
 
 class BaseAppTest:
@@ -7,7 +7,7 @@
 
     def setup_class(cls):
         try:
-            import pypy.rlib.rstacklet
+            import rpython.rlib.rstacklet
         except CompilationError, e:
             py.test.skip("cannot import rstacklet: %s" % e)
 
diff --git a/pypy/module/_csv/interp_reader.py b/pypy/module/_csv/interp_reader.py
--- a/pypy/module/_csv/interp_reader.py
+++ b/pypy/module/_csv/interp_reader.py
@@ -1,4 +1,4 @@
-from pypy.rlib.rstring import StringBuilder
+from rpython.rlib.rstring import StringBuilder
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import unwrap_spec
diff --git a/pypy/module/_csv/interp_writer.py b/pypy/module/_csv/interp_writer.py
--- a/pypy/module/_csv/interp_writer.py
+++ b/pypy/module/_csv/interp_writer.py
@@ -1,4 +1,4 @@
-from pypy.rlib.rstring import StringBuilder
+from rpython.rlib.rstring import StringBuilder
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.typedef import TypeDef, interp2app
diff --git a/pypy/module/_demo/demo.py b/pypy/module/_demo/demo.py
--- a/pypy/module/_demo/demo.py
+++ b/pypy/module/_demo/demo.py
@@ -2,9 +2,9 @@
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
-from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rtyper.lltypesystem import rffi, lltype
+from rpython.rtyper.tool import rffi_platform
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 import sys, math
 
 time_t = rffi_platform.getsimpletype('time_t', '#include <time.h>', rffi.LONG)
diff --git a/pypy/module/_ffi/interp_ffitype.py b/pypy/module/_ffi/interp_ffitype.py
--- a/pypy/module/_ffi/interp_ffitype.py
+++ b/pypy/module/_ffi/interp_ffitype.py
@@ -1,6 +1,6 @@
-from pypy.rlib import libffi, clibffi
-from pypy.rlib.rarithmetic import intmask
-from pypy.rlib import jit
+from rpython.rlib import libffi, clibffi
+from rpython.rlib.rarithmetic import intmask
+from rpython.rlib import jit
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
 from pypy.interpreter.gateway import interp2app
diff --git a/pypy/module/_ffi/interp_funcptr.py b/pypy/module/_ffi/interp_funcptr.py
--- a/pypy/module/_ffi/interp_funcptr.py
+++ b/pypy/module/_ffi/interp_funcptr.py
@@ -5,14 +5,14 @@
 from pypy.interpreter.typedef import TypeDef
 from pypy.module._ffi.interp_ffitype import W_FFIType
 #
-from pypy.rpython.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 #
-from pypy.rlib import jit
-from pypy.rlib import libffi
-from pypy.rlib.clibffi import get_libc_name, StackCheckError, LibFFIError
-from pypy.rlib.rdynload import DLOpenError
-from pypy.rlib.rarithmetic import intmask, r_uint
-from pypy.rlib.objectmodel import we_are_translated
+from rpython.rlib import jit
+from rpython.rlib import libffi
+from rpython.rlib.clibffi import get_libc_name, StackCheckError, LibFFIError
+from rpython.rlib.rdynload import DLOpenError
+from rpython.rlib.rarithmetic import intmask, r_uint
+from rpython.rlib.objectmodel import we_are_translated
 from pypy.module._ffi.type_converter import FromAppLevelConverter, ToAppLevelConverter
 from pypy.module._rawffi.interp_rawffi import got_libffi_error
 
diff --git a/pypy/module/_ffi/interp_struct.py b/pypy/module/_ffi/interp_struct.py
--- a/pypy/module/_ffi/interp_struct.py
+++ b/pypy/module/_ffi/interp_struct.py
@@ -1,9 +1,9 @@
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.rlib import clibffi
-from pypy.rlib import libffi
-from pypy.rlib import jit
-from pypy.rlib.rgc import must_be_light_finalizer
-from pypy.rlib.rarithmetic import r_uint, r_ulonglong, r_singlefloat, intmask
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rlib import clibffi
+from rpython.rlib import libffi
+from rpython.rlib import jit
+from rpython.rlib.rgc import must_be_light_finalizer
+from rpython.rlib.rarithmetic import r_uint, r_ulonglong, r_singlefloat, intmask
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
diff --git a/pypy/module/_ffi/test/test_funcptr.py b/pypy/module/_ffi/test/test_funcptr.py
--- a/pypy/module/_ffi/test/test_funcptr.py
+++ b/pypy/module/_ffi/test/test_funcptr.py
@@ -1,8 +1,8 @@
-from pypy.rpython.lltypesystem import rffi
-from pypy.rlib.clibffi import get_libc_name
-from pypy.rlib.libffi import types
-from pypy.rlib.libffi import CDLL
-from pypy.rlib.test.test_clibffi import get_libm_name
+from rpython.rtyper.lltypesystem import rffi
+from rpython.rlib.clibffi import get_libc_name
+from rpython.rlib.libffi import types
+from rpython.rlib.libffi import CDLL
+from rpython.rlib.test.test_clibffi import get_libm_name
 
 import sys, py
 
@@ -12,8 +12,8 @@
     @classmethod
     def prepare_c_example(cls):
         from pypy.tool.udir import udir
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
-        from pypy.translator.platform import platform
+        from rpython.translator.tool.cbuild import ExternalCompilationInfo
+        from rpython.translator.platform import platform
 
         c_file = udir.ensure("test__ffi", dir=1).join("foolib.c")
         # automatically collect the C source from the docstrings of the tests
diff --git a/pypy/module/_ffi/test/test_struct.py b/pypy/module/_ffi/test/test_struct.py
--- a/pypy/module/_ffi/test/test_struct.py
+++ b/pypy/module/_ffi/test/test_struct.py
@@ -58,9 +58,9 @@
         else:
             cls.w_read_raw_mem = cls.space.wrap(interp2app(read_raw_mem))
         #
-        from pypy.rlib import clibffi
-        from pypy.rlib.rarithmetic import r_uint
-        from pypy.rpython.lltypesystem import lltype, rffi
+        from rpython.rlib import clibffi
+        from rpython.rlib.rarithmetic import r_uint
+        from rpython.rtyper.lltypesystem import lltype, rffi
         dummy_type = lltype.malloc(clibffi.FFI_TYPE_P.TO, flavor='raw')
         dummy_type.c_size = r_uint(123)
         dummy_type.c_alignment = rffi.cast(rffi.USHORT, 0)
diff --git a/pypy/module/_ffi/test/test_type_converter.py b/pypy/module/_ffi/test/test_type_converter.py
--- a/pypy/module/_ffi/test/test_type_converter.py
+++ b/pypy/module/_ffi/test/test_type_converter.py
@@ -1,6 +1,6 @@
 import sys
-from pypy.rlib.rarithmetic import r_uint, r_singlefloat, r_longlong, r_ulonglong
-from pypy.rlib.libffi import IS_32_BIT
+from rpython.rlib.rarithmetic import r_uint, r_singlefloat, r_longlong, r_ulonglong
+from rpython.rlib.libffi import IS_32_BIT
 from pypy.module._ffi.interp_ffitype import app_types, descr_new_pointer
 from pypy.module._ffi.type_converter import FromAppLevelConverter, ToAppLevelConverter
 
diff --git a/pypy/module/_ffi/type_converter.py b/pypy/module/_ffi/type_converter.py
--- a/pypy/module/_ffi/type_converter.py
+++ b/pypy/module/_ffi/type_converter.py
@@ -1,7 +1,7 @@
-from pypy.rlib import libffi
-from pypy.rlib import jit
-from pypy.rlib.rarithmetic import intmask, r_uint
-from pypy.rpython.lltypesystem import rffi
+from rpython.rlib import libffi
+from rpython.rlib import jit
+from rpython.rlib.rarithmetic import intmask, r_uint
+from rpython.rtyper.lltypesystem import rffi
 from pypy.interpreter.error import operationerrfmt, OperationError
 from pypy.module._rawffi.structure import W_StructureInstance, W_Structure
 from pypy.module._ffi.interp_ffitype import app_types
@@ -73,7 +73,7 @@
     def _singlefloat(self, w_ffitype, w_obj):
         # a separate function, which can be seen by the jit or not,
         # depending on whether singlefloats are supported
-        from pypy.rlib.rarithmetic import r_singlefloat
+        from rpython.rlib.rarithmetic import r_singlefloat
         floatval = self.space.float_w(w_obj)
         singlefloatval = r_singlefloat(floatval)
         self.handle_singlefloat(w_ffitype, w_obj, singlefloatval)
diff --git a/pypy/module/_file/interp_file.py b/pypy/module/_file/interp_file.py
--- a/pypy/module/_file/interp_file.py
+++ b/pypy/module/_file/interp_file.py
@@ -2,9 +2,9 @@
 import os
 import stat
 import errno
-from pypy.rlib import streamio
-from pypy.rlib.rarithmetic import r_longlong
-from pypy.rlib.rstring import StringBuilder
+from rpython.rlib import streamio
+from rpython.rlib.rarithmetic import r_longlong
+from rpython.rlib.rstring import StringBuilder
 from pypy.module._file.interp_stream import W_AbstractStream, StreamErrors
 from pypy.module.posix.interp_posix import dispatch_filename
 from pypy.interpreter.error import OperationError, operationerrfmt
diff --git a/pypy/module/_file/interp_stream.py b/pypy/module/_file/interp_stream.py
--- a/pypy/module/_file/interp_stream.py
+++ b/pypy/module/_file/interp_stream.py
@@ -1,6 +1,6 @@
 import py
-from pypy.rlib import streamio
-from pypy.rlib.streamio import StreamErrors
+from rpython.rlib import streamio
+from rpython.rlib.streamio import StreamErrors
 
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.baseobjspace import ObjSpace, Wrappable
diff --git a/pypy/module/_hashlib/__init__.py b/pypy/module/_hashlib/__init__.py
--- a/pypy/module/_hashlib/__init__.py
+++ b/pypy/module/_hashlib/__init__.py
@@ -14,5 +14,5 @@
         interpleveldefs['openssl_' + name] = 'interp_hashlib.new_' + name
 
     def startup(self, space):
-        from pypy.rlib.ropenssl import init_digests
+        from rpython.rlib.ropenssl import init_digests
         init_digests()
diff --git a/pypy/module/_hashlib/interp_hashlib.py b/pypy/module/_hashlib/interp_hashlib.py
--- a/pypy/module/_hashlib/interp_hashlib.py
+++ b/pypy/module/_hashlib/interp_hashlib.py
@@ -4,10 +4,10 @@
 from pypy.interpreter.error import OperationError
 from pypy.tool.sourcetools import func_renamer
 from pypy.interpreter.baseobjspace import Wrappable
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.rlib import rgc, ropenssl
-from pypy.rlib.objectmodel import keepalive_until_here
-from pypy.rlib.rstring import StringBuilder
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from rpython.rlib import rgc, ropenssl
+from rpython.rlib.objectmodel import keepalive_until_here
+from rpython.rlib.rstring import StringBuilder
 from pypy.module.thread.os_lock import Lock
 
 algorithms = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
diff --git a/pypy/module/_io/interp_bufferedio.py b/pypy/module/_io/interp_bufferedio.py
--- a/pypy/module/_io/interp_bufferedio.py
+++ b/pypy/module/_io/interp_bufferedio.py
@@ -4,9 +4,9 @@
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.buffer import RWBuffer
-from pypy.rlib.rstring import StringBuilder
-from pypy.rlib.rarithmetic import r_longlong, intmask
-from pypy.rlib import rposix
+from rpython.rlib.rstring import StringBuilder
+from rpython.rlib.rarithmetic import r_longlong, intmask
+from rpython.rlib import rposix
 from pypy.tool.sourcetools import func_renamer
 from pypy.module._io.interp_iobase import (
     W_IOBase, DEFAULT_BUFFER_SIZE, convert_size,
diff --git a/pypy/module/_io/interp_bytesio.py b/pypy/module/_io/interp_bytesio.py
--- a/pypy/module/_io/interp_bytesio.py
+++ b/pypy/module/_io/interp_bytesio.py
@@ -2,13 +2,13 @@
     TypeDef, generic_new_descr, GetSetProperty)
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rlib.rarithmetic import r_longlong
+from rpython.rlib.rarithmetic import r_longlong
 from pypy.module._io.interp_bufferedio import W_BufferedIOBase
 from pypy.module._io.interp_iobase import convert_size
 import sys
 
 def buffer2string(buffer, start, end):
-    from pypy.rlib.rstring import StringBuilder
+    from rpython.rlib.rstring import StringBuilder
     builder = StringBuilder(end - start)
     for i in range(start, end):
         builder.append(buffer[i])
diff --git a/pypy/module/_io/interp_fileio.py b/pypy/module/_io/interp_fileio.py
--- a/pypy/module/_io/interp_fileio.py
+++ b/pypy/module/_io/interp_fileio.py
@@ -1,8 +1,8 @@
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty, GetSetProperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.error import OperationError, wrap_oserror, wrap_oserror2
-from pypy.rlib.rarithmetic import r_longlong
-from pypy.rlib.rstring import StringBuilder
+from rpython.rlib.rarithmetic import r_longlong
+from rpython.rlib.rstring import StringBuilder
 from os import O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_TRUNC
 import sys, os, stat, errno
 from pypy.module._io.interp_iobase import W_RawIOBase, convert_size
@@ -401,7 +401,7 @@
 
     if sys.platform == "win32":
         def _truncate(self, size):
-            from pypy.rlib.streamio import ftruncate_win32
+            from rpython.rlib.streamio import ftruncate_win32
             ftruncate_win32(self.fd, size)
     else:
         def _truncate(self, size):
diff --git a/pypy/module/_io/interp_io.py b/pypy/module/_io/interp_io.py
--- a/pypy/module/_io/interp_io.py
+++ b/pypy/module/_io/interp_io.py
@@ -7,7 +7,7 @@
 from pypy.module.exceptions.interp_exceptions import W_IOError
 from pypy.module._io.interp_fileio import W_FileIO
 from pypy.module._io.interp_textio import W_TextIOWrapper
-from pypy.rpython.module.ll_os_stat import STAT_FIELD_TYPES
+from rpython.rtyper.module.ll_os_stat import STAT_FIELD_TYPES
 
 
 class W_BlockingIOError(W_IOError):
diff --git a/pypy/module/_io/interp_iobase.py b/pypy/module/_io/interp_iobase.py
--- a/pypy/module/_io/interp_iobase.py
+++ b/pypy/module/_io/interp_iobase.py
@@ -4,8 +4,8 @@
     make_weakref_descr)
 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.rlib.rstring import StringBuilder
-from pypy.rlib import rweakref
+from rpython.rlib.rstring import StringBuilder
+from rpython.rlib import rweakref
 
 
 DEFAULT_BUFFER_SIZE = 8192
diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py
--- a/pypy/module/_io/interp_textio.py
+++ b/pypy/module/_io/interp_textio.py
@@ -5,9 +5,9 @@
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.error import OperationError
-from pypy.rlib.rarithmetic import intmask, r_ulonglong, r_uint
-from pypy.rlib.rbigint import rbigint
-from pypy.rlib.rstring import UnicodeBuilder
+from rpython.rlib.rarithmetic import intmask, r_ulonglong, r_uint
+from rpython.rlib.rbigint import rbigint
+from rpython.rlib.rstring import UnicodeBuilder
 from pypy.module._codecs import interp_codecs
 from pypy.module._io.interp_iobase import convert_size
 import sys
diff --git a/pypy/module/_locale/__init__.py b/pypy/module/_locale/__init__.py
--- a/pypy/module/_locale/__init__.py
+++ b/pypy/module/_locale/__init__.py
@@ -1,5 +1,5 @@
 from pypy.interpreter.mixedmodule import MixedModule
-from pypy.rlib import rlocale
+from rpython.rlib import rlocale
 import sys
 
 class Module(MixedModule):
diff --git a/pypy/module/_locale/interp_locale.py b/pypy/module/_locale/interp_locale.py
--- a/pypy/module/_locale/interp_locale.py
+++ b/pypy/module/_locale/interp_locale.py
@@ -1,12 +1,12 @@
-from pypy.rlib import rposix
-from pypy.rlib.rarithmetic import intmask
+from rpython.rlib import rposix
+from rpython.rlib.rarithmetic import intmask
 
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import unwrap_spec
 
-from pypy.rlib import rlocale
+from rpython.rlib import rlocale
 from pypy.module.exceptions.interp_exceptions import _new_exception, W_Exception
-from pypy.rpython.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 
 W_Error = _new_exception('Error', W_Exception, 'locale error')
 
diff --git a/pypy/module/_lsprof/interp_lsprof.py b/pypy/module/_lsprof/interp_lsprof.py
--- a/pypy/module/_lsprof/interp_lsprof.py
+++ b/pypy/module/_lsprof/interp_lsprof.py
@@ -6,13 +6,13 @@
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import (TypeDef, GetSetProperty,
                                       interp_attrproperty)
-from pypy.rlib import jit
-from pypy.rlib.objectmodel import we_are_translated
-from pypy.rlib.rtimer import read_timestamp, _is_64_bit
-from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rlib import jit
+from rpython.rlib.objectmodel import we_are_translated
+from rpython.rlib.rtimer import read_timestamp, _is_64_bit
+from rpython.rtyper.lltypesystem import rffi, lltype
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.tool.autopath import pypydir
-from pypy.rlib.rarithmetic import r_longlong
+from rpython.rlib.rarithmetic import r_longlong
 
 import time, sys
 
diff --git a/pypy/module/_md5/interp_md5.py b/pypy/module/_md5/interp_md5.py
--- a/pypy/module/_md5/interp_md5.py
+++ b/pypy/module/_md5/interp_md5.py
@@ -1,4 +1,4 @@
-from pypy.rlib import rmd5
+from rpython.rlib import rmd5
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
diff --git a/pypy/module/_minimal_curses/__init__.py b/pypy/module/_minimal_curses/__init__.py
--- a/pypy/module/_minimal_curses/__init__.py
+++ b/pypy/module/_minimal_curses/__init__.py
@@ -10,7 +10,7 @@
 from pypy.interpreter.mixedmodule import MixedModule
 from pypy.module._minimal_curses import fficurses
 from pypy.module._minimal_curses import interp_curses
-from pypy.rlib.nonconst import NonConstant
+from rpython.rlib.nonconst import NonConstant
 
 
 class Module(MixedModule):
diff --git a/pypy/module/_minimal_curses/fficurses.py b/pypy/module/_minimal_curses/fficurses.py
--- a/pypy/module/_minimal_curses/fficurses.py
+++ b/pypy/module/_minimal_curses/fficurses.py
@@ -2,12 +2,12 @@
 """ The ffi for rpython, need to be imported for side effects
 """
 
-from pypy.rpython.lltypesystem import rffi
-from pypy.rpython.lltypesystem import lltype
-from pypy.rpython.tool import rffi_platform
-from pypy.rpython.extfunc import register_external
+from rpython.rtyper.lltypesystem import rffi
+from rpython.rtyper.lltypesystem import lltype
+from rpython.rtyper.tool import rffi_platform
+from rpython.rtyper.extfunc import register_external
 from pypy.module._minimal_curses import interp_curses
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from sys import platform
 import os.path
 
diff --git a/pypy/module/_minimal_curses/interp_curses.py b/pypy/module/_minimal_curses/interp_curses.py
--- a/pypy/module/_minimal_curses/interp_curses.py
+++ b/pypy/module/_minimal_curses/interp_curses.py
@@ -13,8 +13,8 @@
     def __init__(self, msg):
         self.msg = msg
 
-from pypy.annotation.classdef import FORCE_ATTRIBUTES_INTO_CLASSES
-from pypy.annotation.model import SomeString
+from rpython.annotator.classdef import FORCE_ATTRIBUTES_INTO_CLASSES
+from rpython.annotator.model import SomeString
 
 # this is necessary due to annmixlevel
 FORCE_ATTRIBUTES_INTO_CLASSES[curses_error] = {'msg': SomeString()}
diff --git a/pypy/module/_minimal_curses/test/test_curses.py b/pypy/module/_minimal_curses/test/test_curses.py
--- a/pypy/module/_minimal_curses/test/test_curses.py
+++ b/pypy/module/_minimal_curses/test/test_curses.py
@@ -75,7 +75,7 @@
     """ Test compiled version
     """
     def test_csetupterm(self):
-        from pypy.translator.c.test.test_genc import compile
+        from rpython.translator.c.test.test_genc import compile
         from pypy.module._minimal_curses import interp_curses
         def runs_setupterm():
             interp_curses._curses_setupterm_null(1)
@@ -84,7 +84,7 @@
         fn()
 
     def test_ctgetstr(self):
-        from pypy.translator.c.test.test_genc import compile
+        from rpython.translator.c.test.test_genc import compile
         from pypy.module._minimal_curses import interp_curses
         def runs_ctgetstr():
             interp_curses._curses_setupterm("xterm", 1)
@@ -95,7 +95,7 @@
         assert res == '\x1b[%i%p1%d;%p2%dH'
 
     def test_ctparm(self):
-        from pypy.translator.c.test.test_genc import compile
+        from rpython.translator.c.test.test_genc import compile
         from pypy.module._minimal_curses import interp_curses
         def runs_tparm():
             interp_curses._curses_setupterm("xterm", 1)
diff --git a/pypy/module/_multibytecodec/c_codecs.py b/pypy/module/_multibytecodec/c_codecs.py
--- a/pypy/module/_multibytecodec/c_codecs.py
+++ b/pypy/module/_multibytecodec/c_codecs.py
@@ -1,6 +1,6 @@
 import py
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.tool.autopath import pypydir
 
 UNICODE_REPLACEMENT_CHARACTER = u'\uFFFD'
diff --git a/pypy/module/_multibytecodec/interp_incremental.py b/pypy/module/_multibytecodec/interp_incremental.py
--- a/pypy/module/_multibytecodec/interp_incremental.py
+++ b/pypy/module/_multibytecodec/interp_incremental.py
@@ -1,4 +1,4 @@
-from pypy.rpython.lltypesystem import lltype
+from rpython.rtyper.lltypesystem import lltype
 from pypy.module._multibytecodec import c_codecs
 from pypy.module._multibytecodec.interp_multibytecodec import (
     MultibyteCodec, wrap_unicodedecodeerror, wrap_runtimeerror,
diff --git a/pypy/module/_multibytecodec/test/test_translation.py b/pypy/module/_multibytecodec/test/test_translation.py
--- a/pypy/module/_multibytecodec/test/test_translation.py
+++ b/pypy/module/_multibytecodec/test/test_translation.py
@@ -1,5 +1,5 @@
 from pypy.module._multibytecodec import c_codecs
-from pypy.translator.c.test import test_standalone
+from rpython.translator.c.test import test_standalone
 
 
 class TestTranslation(test_standalone.StandaloneTests):
diff --git a/pypy/module/_multiprocessing/interp_connection.py b/pypy/module/_multiprocessing/interp_connection.py
--- a/pypy/module/_multiprocessing/interp_connection.py
+++ b/pypy/module/_multiprocessing/interp_connection.py
@@ -4,9 +4,9 @@
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.interpreter.error import (
     OperationError, wrap_oserror, operationerrfmt)
-from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.rlib.rarithmetic import intmask
-from pypy.rlib import rpoll, rsocket
+from rpython.rtyper.lltypesystem import rffi, lltype
+from rpython.rlib.rarithmetic import intmask
+from rpython.rlib import rpoll, rsocket
 import sys
 
 READABLE = 1
@@ -194,20 +194,20 @@
 
     if sys.platform == 'win32':
         def WRITE(self, data):
-            from pypy.rlib._rsocket_rffi import send, geterrno
+            from rpython.rlib._rsocket_rffi import send, geterrno
             length = send(self.fd, data, len(data), 0)
             if length < 0:
                 raise WindowsError(geterrno(), "send")
             return length
         def READ(self, size):
-            from pypy.rlib._rsocket_rffi import socketrecv, geterrno
+            from rpython.rlib._rsocket_rffi import socketrecv, geterrno
             with rffi.scoped_alloc_buffer(size) as buf:
                 length = socketrecv(self.fd, buf.raw, buf.size, 0)
                 if length < 0:
                     raise WindowsError(geterrno(), "recv")
                 return buf.str(length)
         def CLOSE(self):
-            from pypy.rlib._rsocket_rffi import socketclose
+            from rpython.rlib._rsocket_rffi import socketclose
             socketclose(self.fd)
     else:
         def WRITE(self, data):
@@ -343,7 +343,7 @@
 
 class W_PipeConnection(W_BaseConnection):
     if sys.platform == 'win32':
-        from pypy.rlib.rwin32 import INVALID_HANDLE_VALUE
+        from rpython.rlib.rwin32 import INVALID_HANDLE_VALUE
 
     def __init__(self, handle, flags):
         W_BaseConnection.__init__(self, flags)
@@ -372,7 +372,7 @@
         return w_handle(space, self.handle)
 
     def do_close(self):
-        from pypy.rlib.rwin32 import CloseHandle
+        from rpython.rlib.rwin32 import CloseHandle
         if self.is_valid():
             CloseHandle(self.handle)
             self.handle = self.INVALID_HANDLE_VALUE
@@ -380,7 +380,7 @@
     def do_send_string(self, space, buffer, offset, size):
         from pypy.module._multiprocessing.interp_win32 import (
             _WriteFile, ERROR_NO_SYSTEM_RESOURCES)
-        from pypy.rlib import rwin32
+        from rpython.rlib import rwin32
 
         charp = rffi.str2charp(buffer)
         written_ptr = lltype.malloc(rffi.CArrayPtr(rwin32.DWORD).TO, 1,
@@ -402,7 +402,7 @@
     def do_recv_string(self, space, buflength, maxlength):
         from pypy.module._multiprocessing.interp_win32 import (
             _ReadFile, _PeekNamedPipe, ERROR_BROKEN_PIPE, ERROR_MORE_DATA)
-        from pypy.rlib import rwin32
+        from rpython.rlib import rwin32
         from pypy.interpreter.error import wrap_windowserror
 
         read_ptr = lltype.malloc(rffi.CArrayPtr(rwin32.DWORD).TO, 1,
@@ -457,7 +457,7 @@
     def do_poll(self, space, timeout):
         from pypy.module._multiprocessing.interp_win32 import (
             _PeekNamedPipe, _GetTickCount, _Sleep)
-        from pypy.rlib import rwin32
+        from rpython.rlib import rwin32
         from pypy.interpreter.error import wrap_windowserror
         bytes_ptr = lltype.malloc(rffi.CArrayPtr(rwin32.DWORD).TO, 1,
                                  flavor='raw')
diff --git a/pypy/module/_multiprocessing/interp_memory.py b/pypy/module/_multiprocessing/interp_memory.py
--- a/pypy/module/_multiprocessing/interp_memory.py
+++ b/pypy/module/_multiprocessing/interp_memory.py
@@ -1,5 +1,5 @@
 from pypy.interpreter.error import OperationError
-from pypy.rpython.lltypesystem import rffi
+from rpython.rtyper.lltypesystem import rffi
 from pypy.module.mmap.interp_mmap import W_MMap
 
 def address_of_buffer(space, w_obj):
diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py
--- a/pypy/module/_multiprocessing/interp_semaphore.py
+++ b/pypy/module/_multiprocessing/interp_semaphore.py
@@ -3,11 +3,11 @@
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.error import wrap_oserror, OperationError
-from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.rlib import rgc
-from pypy.rlib.rarithmetic import r_uint
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.rpython.tool import rffi_platform as platform
+from rpython.rtyper.lltypesystem import rffi, lltype
+from rpython.rlib import rgc
+from rpython.rlib.rarithmetic import r_uint
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rtyper.tool import rffi_platform as platform
 from pypy.module.thread import ll_thread
 from pypy.module._multiprocessing.interp_connection import w_handle
 import sys, os, time, errno
@@ -15,7 +15,7 @@
 RECURSIVE_MUTEX, SEMAPHORE = range(2)
 
 if sys.platform == 'win32':
-    from pypy.rlib import rwin32
+    from rpython.rlib import rwin32
     from pypy.module._multiprocessing.interp_win32 import (
         handle_w, _GetTickCount)
 
@@ -31,7 +31,7 @@
         rwin32.BOOL)
 
 else:
-    from pypy.rlib import rposix
+    from rpython.rlib import rposix
 
     if sys.platform == 'darwin':
         libraries = []
diff --git a/pypy/module/_multiprocessing/interp_win32.py b/pypy/module/_multiprocessing/interp_win32.py
--- a/pypy/module/_multiprocessing/interp_win32.py
+++ b/pypy/module/_multiprocessing/interp_win32.py
@@ -1,11 +1,11 @@
 from pypy.interpreter.gateway import unwrap_spec, interp2app
 from pypy.interpreter.function import StaticMethod
 from pypy.interpreter.error import wrap_windowserror, OperationError
-from pypy.rlib import rwin32
-from pypy.rlib.rarithmetic import r_uint
-from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.rpython.tool import rffi_platform
+from rpython.rlib import rwin32
+from rpython.rlib.rarithmetic import r_uint
+from rpython.rtyper.lltypesystem import rffi, lltype
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rtyper.tool import rffi_platform
 from pypy.module._multiprocessing.interp_connection import w_handle
 
 CONSTANTS = """
diff --git a/pypy/module/_pickle_support/maker.py b/pypy/module/_pickle_support/maker.py
--- a/pypy/module/_pickle_support/maker.py
+++ b/pypy/module/_pickle_support/maker.py
@@ -6,7 +6,7 @@
 from pypy.interpreter.pyframe import PyFrame
 from pypy.interpreter.pytraceback import PyTraceback
 from pypy.interpreter.generator import GeneratorIterator
-from pypy.rlib.objectmodel import instantiate
+from rpython.rlib.objectmodel import instantiate
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.objspace.std.iterobject import W_SeqIterObject, W_ReverseSeqIterObject
 
diff --git a/pypy/module/_random/interp_random.py b/pypy/module/_random/interp_random.py
--- a/pypy/module/_random/interp_random.py
+++ b/pypy/module/_random/interp_random.py
@@ -2,8 +2,8 @@
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.baseobjspace import Wrappable
-from pypy.rlib.rarithmetic import r_uint, intmask
-from pypy.rlib import rbigint, rrandom, rstring
+from rpython.rlib.rarithmetic import r_uint, intmask
+from rpython.rlib import rbigint, rrandom, rstring
 
 import time
 
diff --git a/pypy/module/_rawffi/__init__.py b/pypy/module/_rawffi/__init__.py
--- a/pypy/module/_rawffi/__init__.py
+++ b/pypy/module/_rawffi/__init__.py
@@ -4,7 +4,7 @@
 
 from pypy.interpreter.mixedmodule import MixedModule
 from pypy.module._rawffi.interp_rawffi import W_CDLL
-from pypy.rpython.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 from pypy.module._rawffi.tracker import Tracker
 import sys
 
@@ -46,7 +46,7 @@
         if hasattr(interp_rawffi, 'check_HRESULT'):
             Module.interpleveldefs['check_HRESULT'] = 'interp_rawffi.check_HRESULT'
 
-        from pypy.rlib import clibffi
+        from rpython.rlib import clibffi
         for name in ['FUNCFLAG_STDCALL', 'FUNCFLAG_CDECL', 'FUNCFLAG_PYTHONAPI',
                      'FUNCFLAG_USE_ERRNO', 'FUNCFLAG_USE_LASTERROR',
                      ]:
diff --git a/pypy/module/_rawffi/array.py b/pypy/module/_rawffi/array.py
--- a/pypy/module/_rawffi/array.py
+++ b/pypy/module/_rawffi/array.py
@@ -5,7 +5,7 @@
 
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty, interp_attrproperty
-from pypy.rpython.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 from pypy.interpreter.error import OperationError
 from pypy.module._rawffi.interp_rawffi import segfault_exception
 from pypy.module._rawffi.interp_rawffi import W_DataShape, W_DataInstance
@@ -13,7 +13,7 @@
 from pypy.module._rawffi.interp_rawffi import TYPEMAP
 from pypy.module._rawffi.interp_rawffi import size_alignment
 from pypy.module._rawffi.interp_rawffi import unpack_shape_with_length
-from pypy.rlib.rarithmetic import r_uint
+from rpython.rlib.rarithmetic import r_uint
 
 def push_elem(ll_array, pos, value):
     TP = lltype.typeOf(value)
diff --git a/pypy/module/_rawffi/callback.py b/pypy/module/_rawffi/callback.py
--- a/pypy/module/_rawffi/callback.py
+++ b/pypy/module/_rawffi/callback.py
@@ -1,14 +1,14 @@
 
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
-from pypy.rpython.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 from pypy.module._rawffi.array import push_elem
 from pypy.module._rawffi.structure import W_Structure
 from pypy.module._rawffi.interp_rawffi import (W_DataInstance, letter2tp,
      unwrap_value, unpack_argshapes, got_libffi_error)
-from pypy.rlib.clibffi import USERDATA_P, CallbackFuncPtr, FUNCFLAG_CDECL
-from pypy.rlib.clibffi import ffi_type_void, LibFFIError
-from pypy.rlib import rweakref
+from rpython.rlib.clibffi import USERDATA_P, CallbackFuncPtr, FUNCFLAG_CDECL
+from rpython.rlib.clibffi import ffi_type_void, LibFFIError
+from rpython.rlib import rweakref
 from pypy.module._rawffi.tracker import tracker
 from pypy.interpreter.error import OperationError
 from pypy.interpreter import gateway
diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py
--- a/pypy/module/_rawffi/interp_rawffi.py
+++ b/pypy/module/_rawffi/interp_rawffi.py
@@ -3,18 +3,18 @@
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 
-from pypy.rlib.clibffi import *
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.rlib.unroll import unrolling_iterable
-import pypy.rlib.rposix as rposix
+from rpython.rlib.clibffi import *
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rlib.unroll import unrolling_iterable
+import rpython.rlib.rposix as rposix
 
 _MS_WINDOWS = os.name == "nt"
 
 if _MS_WINDOWS:
-    from pypy.rlib import rwin32
+    from rpython.rlib import rwin32
 
 from pypy.tool.sourcetools import func_with_new_name
-from pypy.rlib.rarithmetic import intmask, r_uint
+from rpython.rlib.rarithmetic import intmask, r_uint
 from pypy.module._rawffi.tracker import tracker
 
 TYPEMAP = {
@@ -553,11 +553,11 @@
 
 if sys.platform == 'win32':
     def get_last_error(space):
-        from pypy.rlib.rwin32 import GetLastError
+        from rpython.rlib.rwin32 import GetLastError
         return space.wrap(GetLastError())
     @unwrap_spec(error=int)
     def set_last_error(space, error):
-        from pypy.rlib.rwin32 import SetLastError
+        from rpython.rlib.rwin32 import SetLastError
         SetLastError(error)
 else:
     # always have at least a dummy version of these functions
diff --git a/pypy/module/_rawffi/structure.py b/pypy/module/_rawffi/structure.py
--- a/pypy/module/_rawffi/structure.py
+++ b/pypy/module/_rawffi/structure.py
@@ -6,7 +6,7 @@
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import interp_attrproperty
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
-from pypy.rpython.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.module._rawffi.interp_rawffi import segfault_exception, _MS_WINDOWS
 from pypy.module._rawffi.interp_rawffi import W_DataShape, W_DataInstance
@@ -14,8 +14,8 @@
 from pypy.module._rawffi.interp_rawffi import unpack_shape_with_length
 from pypy.module._rawffi.interp_rawffi import size_alignment, LL_TYPEMAP
 from pypy.module._rawffi.interp_rawffi import unroll_letters_for_numbers
-from pypy.rlib import clibffi
-from pypy.rlib.rarithmetic import intmask, r_uint, signedtype, widen
+from rpython.rlib import clibffi
+from rpython.rlib.rarithmetic import intmask, r_uint, signedtype, widen
 
 def unpack_fields(space, w_fields):
     fields_w = space.unpackiterable(w_fields)
diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py
--- a/pypy/module/_rawffi/test/test__rawffi.py
+++ b/pypy/module/_rawffi/test/test__rawffi.py
@@ -1,5 +1,5 @@
-from pypy.translator.platform import platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.translator.platform import platform
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.module._rawffi.interp_rawffi import TYPEMAP
 from pypy.module._rawffi.tracker import Tracker
 
@@ -197,7 +197,7 @@
     
     def setup_class(cls):
         space = cls.space
-        from pypy.rlib.clibffi import get_libc_name
+        from rpython.rlib.clibffi import get_libc_name
         cls.w_lib_name = space.wrap(cls.prepare_c_example())
         cls.w_libc_name = space.wrap(get_libc_name())
         if sys.platform == 'win32':
diff --git a/pypy/module/_sha/interp_sha.py b/pypy/module/_sha/interp_sha.py
--- a/pypy/module/_sha/interp_sha.py
+++ b/pypy/module/_sha/interp_sha.py
@@ -1,4 +1,4 @@
-from pypy.rlib import rsha
+from rpython.rlib import rsha
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.typedef import TypeDef


More information about the pypy-commit mailing list