From 2c4f9cb22619ccedf605147bfd148bd6eec535ac Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 29 May 2019 19:51:43 -0700 Subject: [PATCH] Install and use pathlib2 only for Python2 --- build.py | 7 +++++-- requirements/devel.txt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index df6014a1..03948d39 100755 --- a/build.py +++ b/build.py @@ -27,7 +27,10 @@ import tarfile import tempfile import datetime -import pathlib2 +try: + import pathlib +except ImportError: + import pathlib2 as pathlib from distutils.dep_util import newer, newer_group from buildtools.config import Config, msg, opj, posixjoin, loadETG, etg2sip, findCmd, \ @@ -1183,7 +1186,7 @@ def cmd_sip(options, args): def cmd_touch(options, args): cmdTimer = CommandTimer('touch') pwd = pushDir(phoenixDir()) - etg = pathlib2.Path('etg') + etg = pathlib.Path('etg') for item in etg.glob('*.py'): item.touch() diff --git a/requirements/devel.txt b/requirements/devel.txt index 80c2ff07..0fec2567 100644 --- a/requirements/devel.txt +++ b/requirements/devel.txt @@ -9,4 +9,4 @@ requests pytest pytest-xdist pytest-timeout -pathlib2 +pathlib2 ; python_version < "3"