提交 bc7f3b0b 编写于 作者: P Philippe Mathieu-Daudé

scripts/checkpatch.pl: Only allow Python 3 interpreter

Since commit ddf90699 QEMU requires Python >= 3.5.

PEP 0394 [*] states that 'python3' should be available and
that 'python' is optional.

To avoid problem with unsupported versions, enforce the
shebang interpreter to Python 3.

[*] https://www.python.org/dev/peps/pep-0394/Reported-by: NJohn Snow <jsnow@redhat.com>
Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200130163232.10446-2-philmd@redhat.com>
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
上级 5427ecd4
......@@ -1460,6 +1460,12 @@ sub process {
}
}
# Only allow Python 3 interpreter
if ($realline == 1 &&
$line =~ /^\+#!\ *\/usr\/bin\/(?:env )?python$/) {
ERROR("please use python3 interpreter\n" . $herecurr);
}
# Accept git diff extended headers as valid patches
if ($line =~ /^(?:rename|copy) (?:from|to) [\w\/\.\-]+\s*$/) {
$is_patch = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册