From 500c55697450a26cc1c74013302128b7de1599c8 Mon Sep 17 00:00:00 2001 From: Jiachen YANG Date: Wed, 25 Jul 2018 16:27:36 +0900 Subject: [PATCH] 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):