From d3a66f0bbd59dfeabef43df5e416eb6abd0e6a6b Mon Sep 17 00:00:00 2001 From: Andrew Port Date: Sun, 5 Jun 2022 21:17:28 -0700 Subject: [PATCH] skip pathlib support for python < 3.6 --- test/test_document.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/test_document.py b/test/test_document.py index d96160d..6642a49 100644 --- a/test/test_document.py +++ b/test/test_document.py @@ -4,10 +4,7 @@ from svgpathtools import * from io import StringIO from io import open # overrides build-in open for compatibility with python2 from os.path import join, dirname -try: - import pathlib -except ImportError: - import pathlib2 as pathlib +from sys import version_info class TestDocument(unittest.TestCase): @@ -19,9 +16,11 @@ class TestDocument(unittest.TestCase): def test_from_file_path(self): """Test reading svg from file provided as path""" - doc = Document(pathlib.Path(__file__).parent / 'polygons.svg') + if version_info >= (3, 6): + import pathlib + doc = Document(pathlib.Path(__file__).parent / 'polygons.svg') - self.assertEqual(len(doc.paths()), 2) + self.assertEqual(len(doc.paths()), 2) def test_from_file_object(self): """Test reading svg from file object that has already been opened"""