Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3k
Changeset: r70075:9b55b0c3aacc
Date: 2014-03-18 15:30 -0700
http://bitbucket.org/pypy/pypy/changeset/9b55b0c3aacc/

Log:    fix/cleanup imports

diff --git a/pypy/module/cpyext/memoryobject.py 
b/pypy/module/cpyext/memoryobject.py
--- a/pypy/module/cpyext/memoryobject.py
+++ b/pypy/module/cpyext/memoryobject.py
@@ -1,9 +1,10 @@
-from pypy.interpreter.error import OperationError
-from pypy.module.cpyext.api import cpython_api, Py_buffer
+from rpython.rtyper.lltypesystem import lltype
+
+from pypy.interpreter.error import oefmt
+from pypy.module.cpyext.api import Py_buffer, cpython_api
 from pypy.module.cpyext.pyobject import PyObject, from_ref
 from pypy.module.cpyext.buffer import CBuffer
-from rpython.rtyper.lltypesystem import rffi, lltype
-from pypy.module.__builtin__.interp_memoryview import W_MemoryView
+from pypy.objspace.std.memoryview import W_MemoryView
 
 @cpython_api([PyObject], PyObject)
 def PyMemoryView_FromObject(space, w_obj):
@@ -16,8 +17,9 @@
     means you shouldn't try to call PyBuffer_Release() yourself: it
     will be done on deallocation of the memoryview object."""
     if not view.c_buf:
-        msg = "cannot make memory view from a buffer with a NULL data pointer"
-        raise OperationError(space.w_ValueError, space.wrap(msg))
+        raise oefmt(space.w_ValueError,
+                    "cannot make memory view from a buffer with a NULL data "
+                    "pointer")
     w_obj = from_ref(space, view.c_obj)
     buf = CBuffer(space, view.c_buf, view.c_len, w_obj)
     return space.wrap(W_MemoryView(buf))
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to