From: Philipp Gesang Date: Wed, 29 Jan 2020 09:02:00 +0000 (+0100) Subject: python 3.7 support: Track cpython removal of re._pattern_type X-Git-Tag: v2.2~3 X-Git-Url: http://developer.intra2net.com/git/?p=python-delta-tar;a=commitdiff_plain;h=c9ee01594eec1b3dac1f992860c2954dbd808281 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 --- 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: