summaryrefslogtreecommitdiff
path: root/pelican/generators.py
diff options
context:
space:
mode:
authorJustin Mayer <entroP@gmail.com>2020-04-26 09:55:08 +0200
committerJustin Mayer <entroP@gmail.com>2020-04-27 09:45:31 +0200
commitd43b786b300358e8a4cbae4afc4052199a7af762 (patch)
tree8c2231297301b1eb307e3c132ca4710cacd5eef0 /pelican/generators.py
parent2cd1d44576ecc4fd0cc532cbb19c2b934ab5c665 (diff)
downloadpelican-remove-legacy.tar.gz
Modernize code base to Python 3+ syntaxremove-legacy
Replaces syntax that was relevant in earlier Python versions but that now has modernized equivalents.
Diffstat (limited to 'pelican/generators.py')
-rw-r--r--pelican/generators.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/pelican/generators.py b/pelican/generators.py
index 232f4759..63e20a0a 100644
--- a/pelican/generators.py
+++ b/pelican/generators.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import calendar
import errno
import fnmatch
@@ -28,7 +26,7 @@ class PelicanTemplateNotFound(Exception):
pass
-class Generator(object):
+class Generator:
"""Baseclass generator"""
def __init__(self, context, settings, path, theme, output_path,
@@ -262,7 +260,7 @@ class _FileLoader(BaseLoader):
if template != self.path or not os.path.exists(self.fullpath):
raise TemplateNotFound(template)
mtime = os.path.getmtime(self.fullpath)
- with open(self.fullpath, 'r', encoding='utf-8') as f:
+ with open(self.fullpath, encoding='utf-8') as f:
source = f.read()
return (source, self.fullpath,
lambda: mtime == os.path.getmtime(self.fullpath))