mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Revert "turn utils.open into actual context manager so as to better handle encoding warnings"
This reverts commit 876c7f5093.
This commit is contained in:
parent
1c708a70ba
commit
d9dba38644
1 changed files with 2 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue