diff --git a/django/utils/text.py b/django/utils/text.py
index eaafb96..8f78b00 100644
a
|
b
|
phone2numeric = allow_lazy(phone2numeric)
|
279 | 279 | # Used with permission. |
280 | 280 | def compress_string(s): |
281 | 281 | zbuf = StringIO() |
| 282 | # Wait for Python 2.7 to use the with statement with GzipFile |
282 | 283 | 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() |
285 | 288 | return zbuf.getvalue() |
286 | 289 | |
287 | 290 | ustring_re = re.compile(u"([\u0080-\uffff])") |