mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
remove unittest2 and fix various warnings in py3
This commit is contained in:
parent
091007ddf7
commit
bc4bd773a0
10 changed files with 76 additions and 61 deletions
|
|
@ -192,7 +192,8 @@ class pelican_open(object):
|
|||
self.filename = filename
|
||||
|
||||
def __enter__(self):
|
||||
content = open(self.filename, encoding='utf-8').read()
|
||||
with open(self.filename, encoding='utf-8') as infile:
|
||||
content = infile.read()
|
||||
if content[0] == BOM_UTF8.decode('utf8'):
|
||||
content = content[1:]
|
||||
return content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue