Ticket #6499: 6499-2.diff

File 6499-2.diff, 595 bytes (added by Claude Paroz, 12 years ago)

Updated to current trunk

  • django/utils/text.py

    diff --git a/django/utils/text.py b/django/utils/text.py
    index eaafb96..8f78b00 100644
    a b phone2numeric = allow_lazy(phone2numeric)  
    279279# Used with permission.
    280280def compress_string(s):
    281281    zbuf = StringIO()
     282    # Wait for Python 2.7 to use the with statement with GzipFile
    282283    zfile = GzipFile(mode='wb', compresslevel=6, fileobj=zbuf)
    283     zfile.write(s)
    284     zfile.close()
     284    try:
     285        zfile.write(s)
     286    finally:
     287        zfile.close()
    285288    return zbuf.getvalue()
    286289
    287290ustring_re = re.compile(u"([\u0080-\uffff])")
Back to Top