Skip to content

Commit 80f0e39

Browse files
committed
[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 swiftlang#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
1 parent 5243d3c commit 80f0e39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: utils/line-directive

+1-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ def run():
700700
':(?P<line>[0-9]+):(?P<column>[0-9]+):(?P<tail>.*?)\n?$')
701701

702702
assertion_pattern = re.compile(
703-
'^(?P<head>.*( file | at |#[0-9]+: |[[]))' +
703+
'^(?P<head>.*( file | at |#[0-9]+: |[\[]))' +
704704
sources +
705705
'(?P<middle>, line |:)(?P<line>[0-9]+)(?P<tail>.*?)\n?$')
706706

0 commit comments

Comments
 (0)