From cab2bd2bcb7c5638b018560bbe3fb61ce96bb028 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Tue, 4 Dec 2018 09:49:48 +0100 Subject: Avoid DeprecationWarning in Python 3 The re.match(...) string raised a DeprecationWarning due to the escaped '\(' inside the pattern in Python 3. Using a raw-string instead solved this issue. Change-Id: Ib7f6c66bfdaa03f154ce086abf7ca9bd0baaeb47 Reviewed-by: Friedemann Kleint --- sources/pyside2/PySide2/support/generate_pyi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sources/pyside2') diff --git a/sources/pyside2/PySide2/support/generate_pyi.py b/sources/pyside2/PySide2/support/generate_pyi.py index 7a2c79ba2..bd3e7500a 100644 --- a/sources/pyside2/PySide2/support/generate_pyi.py +++ b/sources/pyside2/PySide2/support/generate_pyi.py @@ -159,7 +159,7 @@ class Formatter(Writer): def _function(self, func_name, signature, spaces): # this would be nicer to get somehow together with the signature - is_meth = re.match("\((\w*)", str(signature)).group(1) == "self" + is_meth = re.match(r"\((\w*)", str(signature)).group(1) == "self" if self.class_name and not is_meth: self.print('{spaces}@staticmethod'.format(**locals())) self.print('{spaces}def {func_name}{signature}: ...'.format(**locals())) -- cgit v1.2.3