From d9dba3864486dd3949e69976619bc993aaee387a Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Mon, 11 Jun 2012 09:00:57 -0400 Subject: [PATCH] Revert "turn utils.open into actual context manager so as to better handle encoding warnings" This reverts commit 876c7f509392d6c245a81e26fd5fd2a81851281f. --- pelican/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index db15a343..d4e34842 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import contextlib import os import re import pytz @@ -33,10 +32,10 @@ def get_date(string): pass raise ValueError("'%s' is not a valid date" % string) -@contextlib.contextmanager + def open(filename): """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):