summaryrefslogtreecommitdiff
path: root/docs/errors.rst
diff options
context:
space:
mode:
authorChase Sterling <chase.sterling@gmail.com>2013-04-07 20:56:18 -0400
committerChase Sterling <chase.sterling@gmail.com>2013-04-07 20:56:18 -0400
commit16ec13c5de36f3be55e8b46a43c29ca083f31785 (patch)
treee3df7ca40bb910521cbdd4e44c215d95cd6ca999 /docs/errors.rst
parentcf7056d6c1975c1a7330a574d58446c3636963e6 (diff)
downloadjsonschema-16ec13c5de36f3be55e8b46a43c29ca083f31785.tar.gz
Use python 3 style prints in docs
Diffstat (limited to 'docs/errors.rst')
-rw-r--r--docs/errors.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/errors.rst b/docs/errors.rst
index 738308c..857a6af 100644
--- a/docs/errors.rst
+++ b/docs/errors.rst
@@ -69,7 +69,7 @@ The error messages in this situation are not very helpful on their own:
.. code-block:: python
>>> for e in errors:
- ... print e.message
+ ... print(e.message)
The instance is not valid under any of the given schemas
The instance is not valid under any of the given schemas
The instance is not valid under any of the given schemas
@@ -82,7 +82,7 @@ will be the index in our list.
.. code-block:: python
>>> for e in errors:
- ... print list(e.path)
+ ... print(list(e.path))
[0]
[1]
[2]
@@ -104,7 +104,7 @@ the schema each of these errors come from. In the case of sub-errors from the
>>> for e in errors:
... for sube in sorted(e.context, key=lambda e: e.schema_path):
- ... print list(sube.schema_path), sube
+ ... print(list(sube.schema_path), sube)
[0, 'type'] {} is not of type 'string'
[1, 'type'] {} is not of type 'integer'
[0, 'type'] 3 is not of type 'string'
@@ -149,7 +149,7 @@ For clarity's sake, the given instance has three errors under this schema:
>>> v = Draft3Validator(schema)
>>> for error in sorted(v.iter_errors(["spam", 2]), key=str):
- ... print error
+ ... print(error)
'spam' is not of type 'number'
'spam' is not one of [1, 2, 3]
['spam', 2] is too short