Revert "turn utils.open into actual context manager so as to better handle encoding warnings"

This reverts commit 876c7f5093.
This commit is contained in:
dave mankoff 2012-06-11 09:00:57 -04:00
commit d9dba38644

View file

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import contextlib
import os import os
import re import re
import pytz import pytz
@ -33,10 +32,10 @@ def get_date(string):
pass pass
raise ValueError("'%s' is not a valid date" % string) raise ValueError("'%s' is not a valid date" % string)
@contextlib.contextmanager
def open(filename): def open(filename):
"""Open a file and return it's content""" """Open a file and return it's content"""
yield _open(filename, encoding='utf-8').read() return _open(filename, encoding='utf-8').read()
def slugify(value): def slugify(value):