[pypy-commit] pypy oefmt: update the docs to mention oefmt() instead of OperationError()

arigo pypy.commits at gmail.com
Mon May 2 11:03:04 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: oefmt
Changeset: r84126:81bcc496d12e
Date: 2016-05-02 17:02 +0200
http://bitbucket.org/pypy/pypy/changeset/81bcc496d12e/

Log:	update the docs to mention oefmt() instead of OperationError()

diff --git a/pypy/doc/coding-guide.rst b/pypy/doc/coding-guide.rst
--- a/pypy/doc/coding-guide.rst
+++ b/pypy/doc/coding-guide.rst
@@ -266,7 +266,13 @@
 
 To raise an application-level exception::
 
-    raise OperationError(space.w_XxxError, space.wrap("message"))
+    from pypy.interpreter.error import oefmt
+
+    raise oefmt(space.w_XxxError, "message")
+
+    raise oefmt(space.w_XxxError, "file '%s' not found in '%s'", filename, dir)
+
+    raise oefmt(space.w_XxxError, "file descriptor '%d' not open", fd)
 
 To catch a specific application-level exception::
 


More information about the pypy-commit mailing list