diff options
author | Justin Mayer <entroP@gmail.com> | 2020-04-26 09:55:08 +0200 |
---|---|---|
committer | Justin Mayer <entroP@gmail.com> | 2020-04-27 09:45:31 +0200 |
commit | d43b786b300358e8a4cbae4afc4052199a7af762 (patch) | |
tree | 8c2231297301b1eb307e3c132ca4710cacd5eef0 /pelican/tests/test_contents.py | |
parent | 2cd1d44576ecc4fd0cc532cbb19c2b934ab5c665 (diff) | |
download | pelican-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/tests/test_contents.py')
-rw-r--r-- | pelican/tests/test_contents.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 4c23a3da..93f5b212 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import datetime import locale import logging @@ -27,7 +25,7 @@ class TestBase(LoggedTestCase): def setUp(self): super().setUp() self.old_locale = locale.setlocale(locale.LC_ALL) - locale.setlocale(locale.LC_ALL, str('C')) + locale.setlocale(locale.LC_ALL, 'C') self.page_kwargs = { 'content': TEST_CONTENT, 'context': { @@ -56,13 +54,13 @@ class TestBase(LoggedTestCase): def _copy_page_kwargs(self): # make a deep copy of page_kwargs - page_kwargs = dict([(key, self.page_kwargs[key]) for key in - self.page_kwargs]) + page_kwargs = {key: self.page_kwargs[key] for key in self.page_kwargs} for key in page_kwargs: if not isinstance(page_kwargs[key], dict): break - page_kwargs[key] = dict([(subkey, page_kwargs[key][subkey]) - for subkey in page_kwargs[key]]) + page_kwargs[key] = { + subkey: page_kwargs[key][subkey] for subkey in page_kwargs[key] + } return page_kwargs |