Skip to content

Commit

Permalink
Fixed #12369 -- Improved example to account for environments where cS…
Browse files Browse the repository at this point in the history
…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
Gabriel Hurley committed Oct 9, 2010
1 parent 6400026 commit 0500105
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/howto/outputting-pdf.txt
Expand Up @@ -101,7 +101,11 @@ cStringIO_ library as a temporary holding place for your PDF file. The cStringIO
library provides a file-like object interface that is particularly efficient.
Here's the above "Hello World" example rewritten to use ``cStringIO``::

from cStringIO import StringIO
# Fall back to StringIO in environments where cStringIO is not available
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from reportlab.pdfgen import canvas
from django.http import HttpResponse

Expand Down

0 comments on commit 0500105

Please sign in to comment.