summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.rst3
-rw-r--r--simplejson/__init__.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/index.rst b/index.rst
index 87e8934..0c25930 100644
--- a/index.rst
+++ b/index.rst
@@ -44,7 +44,8 @@ Compact encoding::
Pretty printing::
>>> import simplejson as json
- >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)
+ >>> s = json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)
+ >>> print '\n'.join([l.rstrip() for l in s.splitlines()])
{
"4": 5,
"6": 7
diff --git a/simplejson/__init__.py b/simplejson/__init__.py
index f385d4c..6313254 100644
--- a/simplejson/__init__.py
+++ b/simplejson/__init__.py
@@ -37,7 +37,8 @@ Compact encoding::
Pretty printing::
>>> import simplejson as json
- >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)
+ >>> s = json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)
+ >>> print '\n'.join([l.rstrip() for l in s.splitlines()])
{
"4": 5,
"6": 7