Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12369 -- Improved example to account for environments where cS…

…tringIO is not available. Thanks to rubic for the report and niall for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14076 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 05001056a861419e2dc112a0395602e5a04f979f 1 parent 6400026
authored October 09, 2010

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  docs/howto/outputting-pdf.txt
6  docs/howto/outputting-pdf.txt
@@ -101,7 +101,11 @@ cStringIO_ library as a temporary holding place for your PDF file. The cStringIO
101 101
 library provides a file-like object interface that is particularly efficient.
102 102
 Here's the above "Hello World" example rewritten to use ``cStringIO``::
103 103
 
104  
-    from cStringIO import StringIO
  104
+    # Fall back to StringIO in environments where cStringIO is not available
  105
+    try:
  106
+        from cStringIO import StringIO
  107
+    except ImportError:
  108
+        from StringIO import StringIO
105 109
     from reportlab.pdfgen import canvas
106 110
     from django.http import HttpResponse
107 111
 

0 notes on commit 0500105

Please sign in to comment.
Something went wrong with that request. Please try again.