Amaury Forgeot d'Arc committed a8477e4

Translation fixes.

Comments (0)

Files changed (5)


         return buffer.as_str()
     def bufferstr0_new_w(self, w_obj):
-        from pypy.rlib import rstring
+        from rpython.rlib import rstring
         result = self.bufferstr_new_w(w_obj)
         if '\x00' in result:
             raise OperationError(self.w_TypeError, self.wrap(


-from pypy.translator.goal import autopath
-from pypy.rpython.lltypesystem import rffi, lltype, llmemory
+from rpython.rtyper.lltypesystem import rffi, lltype, llmemory
 from pypy.module.posix.interp_posix import fsencode_w, run_fork_hooks
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.interpreter.error import (
     OperationError, exception_from_errno, wrap_oserror)
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 import py
 import os
-pypydir = py.path.local(autopath.pypydir)
-thisdir = pypydir.join('module', '_posixsubprocess')
+thisdir = py.path.local(__file__).dirpath()
 eci = ExternalCompilationInfo(


 # XXX Hack to seperate rpython and pypy
 def addr_as_object(addr, fd, space):
+    from rpython.rlib import _rsocket_rffi as _c
     if isinstance(addr, rsocket.INETAddress):
         return space.newtuple([space.wrap(addr.get_host()),
     elif rsocket.HAS_AF_UNIX and isinstance(addr, rsocket.UNIXAddress):
-        path = self.get_path()
+        path = addr.get_path()
         if _c.linux and len(path) > 0 and path[0] == '\x00':
             # Linux abstract namespace
             return space.wrapbytes(path)
     # If we don't know the address family, don't raise an
     # exception -- return it as a tuple.
-    from rpython.rlib import _rsocket_rffi as _c
     a = addr.lock()
     family = rffi.cast(lltype.Signed, a.c_sa_family)
     datalen = addr.addrlen - rsocket.offsetof(_c.sockaddr, 'c_sa_data')
             fd, addr = self.accept()
             return space.newtuple([space.wrap(fd),
-                                   addr.as_object(addr, fd, space)])
+                                   addr_as_object(addr, fd, space)])
         except SocketError, e:
             raise converted_error(space, e)


 from pypy.interpreter.gateway import unwrap_spec
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.argument import Arguments
-from pypy.rlib import runicode, rbigint
-from pypy.rlib.rstruct import ieee
-from pypy.rpython.lltypesystem import rffi
+from rpython.rlib import runicode, rbigint
+from rpython.rlib.rstruct import ieee
+from rpython.rtyper.lltypesystem import rffi
 from pypy.module.array import interp_array


 from pypy.interpreter.gateway import app2interp_temp
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.function import Method
-from pypy.tool import runsubprocess
+from rpython.tool import runsubprocess
 from pypy.tool.pytest import appsupport
 from pypy.tool.pytest.objspace import gettestobjspace
-from pypy.tool.udir import udir
+from rpython.tool.udir import udir
 from pypy.conftest import PyPyClassCollector
 from inspect import getmro