Initial pass of removing Python 2 support

This commit removes Six as a dependency for Pelican, replacing the
relevant aliases with the proper Python 3 imports. It also removes
references to Python 2 logic that did not require Six.
This commit is contained in:
Kevin Yap 2019-11-05 23:17:19 -08:00
commit 1e0e541b57
43 changed files with 126 additions and 459 deletions

View file

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import locale
import logging
@ -11,8 +10,6 @@ from tempfile import mkdtemp
import pytz
import six
from pelican import utils
from pelican.generators import TemplatePagesGenerator
from pelican.settings import read_settings
@ -720,8 +717,7 @@ class TestSanitisedJoin(unittest.TestCase):
@unittest.skipIf(platform == 'win32',
"Different filesystem root on Windows")
def test_detect_parent_breakout(self):
with six.assertRaisesRegex(
self,
with self.assertRaisesRegex(
RuntimeError,
"Attempted to break out of output directory to /foo/test"):
utils.sanitised_join(
@ -732,8 +728,7 @@ class TestSanitisedJoin(unittest.TestCase):
@unittest.skipIf(platform == 'win32',
"Different filesystem root on Windows")
def test_detect_root_breakout(self):
with six.assertRaisesRegex(
self,
with self.assertRaisesRegex(
RuntimeError,
"Attempted to break out of output directory to /test"):
utils.sanitised_join(