Skip to content

Commit

Permalink
[line-directive] Escape literal '['
Browse files Browse the repository at this point in the history
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
  • Loading branch information
davezarzycki committed Apr 14, 2020
1 parent 5243d3c commit 80f0e39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/line-directive
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def run():
':(?P<line>[0-9]+):(?P<column>[0-9]+):(?P<tail>.*?)\n?$')

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

Expand Down

0 comments on commit 80f0e39

Please sign in to comment.