From 80f0e39e1adca851a965d54ed6e7f73774174d82 Mon Sep 17 00:00:00 2001 From: David Zarzycki Date: Tue, 14 Apr 2020 07:17:14 -0400 Subject: [PATCH] [line-directive] Escape literal '[' New versions of Python warn if the literal is not escaped. Specifically: "Support for nested sets and set operations in regular expressions as in Unicode Technical Standard #18 might be added in the future. This would change the syntax. To facilitate this future change a FutureWarning will be raised in ambiguous cases for the time being. That include sets starting with a literal '[' or containing literal character sequences '--', '&&', '~~', and '||'. To avoid a warning, escape them with a backslash. (Contributed by Serhiy Storchaka in bpo-30349.)" https://docs.python.org/dev/whatsnew/3.7.html --- utils/line-directive | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/line-directive b/utils/line-directive index 0f6d05f07cddf..b12260be5da39 100755 --- a/utils/line-directive +++ b/utils/line-directive @@ -700,7 +700,7 @@ def run(): ':(?P[0-9]+):(?P[0-9]+):(?P.*?)\n?$') assertion_pattern = re.compile( - '^(?P.*( file | at |#[0-9]+: |[[]))' + + '^(?P.*( file | at |#[0-9]+: |[\[]))' + sources + '(?P, line |:)(?P[0-9]+)(?P.*?)\n?$')