diff --git a/docs/howto/outputting-pdf.txt b/docs/howto/outputting-pdf.txt index 32e38aebc6..67950d03f2 100644 --- a/docs/howto/outputting-pdf.txt +++ b/docs/howto/outputting-pdf.txt @@ -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