[1.0.X] Fixed a Python 2.4 incompatibility in compress_kml.

Backport of r9607 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9608 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2008-12-08 14:52:39 +00:00
parent 974135fc7e
commit 067361b9c5

View File

@ -5,7 +5,7 @@ from django.template import loader
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."
kmz = cStringIO.StringIO()
zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED, False)
zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED)
zf.writestr('doc.kml', kml)
zf.close()
kmz.seek(0)