From 6d4fcedaccc6a95658bc44ea377f8e28f1ec50b6 Mon Sep 17 00:00:00 2001 From: Jiachen YANG Date: Wed, 25 Jul 2018 15:47:35 +0900 Subject: [PATCH 1/2] fix DeprecationWarnning about collections.abc --- pelican/tests/test_pelican.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index c003c78f..ed70944a 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals -import collections +import collections.abc import locale import logging import os @@ -91,7 +91,7 @@ class TestPelican(LoggedTestCase): generator_classes[-1] is StaticGenerator, "StaticGenerator must be the last generator, but it isn't!") self.assertIsInstance( - generator_classes, collections.Sequence, + generator_classes, collections.abc.Sequence, "get_generator_classes() must return a Sequence to preserve order") def test_basic_generation_works(self): From 500c55697450a26cc1c74013302128b7de1599c8 Mon Sep 17 00:00:00 2001 From: Jiachen YANG Date: Wed, 25 Jul 2018 16:27:36 +0900 Subject: [PATCH 2/2] fix travis tests for py27 by try import collections.abc --- pelican/tests/test_pelican.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index ed70944a..93c240c2 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -1,7 +1,11 @@ # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals -import collections.abc +try: + import collections.abc as collections +except ImportError: + import collections + import locale import logging import os @@ -91,7 +95,7 @@ class TestPelican(LoggedTestCase): generator_classes[-1] is StaticGenerator, "StaticGenerator must be the last generator, but it isn't!") self.assertIsInstance( - generator_classes, collections.abc.Sequence, + generator_classes, collections.Sequence, "get_generator_classes() must return a Sequence to preserve order") def test_basic_generation_works(self):