From c9ee01594eec1b3dac1f992860c2954dbd808281 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 29 Jan 2020 10:02:00 +0100 Subject: [PATCH] python 3.7 support: Track cpython removal of re._pattern_type Another sneaky backward incompatibility introduced by Python 3.7. https://github.com/python/cpython/pull/1646 --- deltatar/deltatar.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deltatar/deltatar.py b/deltatar/deltatar.py index 71bc904..a9f8a9c 100644 --- a/deltatar/deltatar.py +++ b/deltatar/deltatar.py @@ -30,6 +30,7 @@ import shutil import re import stat import json +import typing from functools import partial from . import tarfile @@ -381,7 +382,7 @@ class DeltaTar(object): match = PARENT_MATCH # if it's a reg exp, then we just check if it matches - elif isinstance(i, re._pattern_type): + elif isinstance(i, typing.Pattern): if i.match(path): match = MATCH break @@ -413,7 +414,7 @@ class DeltaTar(object): return NO_MATCH # if it's a reg exp, then we just check if it matches - elif isinstance(e, re._pattern_type): + elif isinstance(e, typing.Pattern): if e.match(path): return NO_MATCH else: -- 1.7.1