]> Git Repo - qemu.git/commitdiff
scripts/checkpatch.pl: Only allow Python 3 interpreter
authorPhilippe Mathieu-Daudé <[email protected]>
Thu, 30 Jan 2020 16:32:21 +0000 (17:32 +0100)
committerPhilippe Mathieu-Daudé <[email protected]>
Fri, 7 Feb 2020 14:12:48 +0000 (15:12 +0100)
Since commit ddf9069963 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: John Snow <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Message-Id: <20200130163232[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
scripts/checkpatch.pl

index 3aef6e3dfe0f1e748d3dd79d9de355ac73cad5d0..ce43a306f867462b39e99aacca29429adc37c4fa 100755 (executable)
@@ -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;
This page took 0.027979 seconds and 4 git commands to generate.