diff options
author | Leif Lindholm <leif@nuviainc.com> | 2020-07-02 23:39:34 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-07-03 00:18:50 +0000 |
commit | f56d52c7f581da4bb732ab6b456718ae59d39efa (patch) | |
tree | daddf52f04d79a464d21bf34a0ce1272fe6f0820 /BaseTools/Scripts | |
parent | c267eb889fe1244840eb4fd067fe0d85e3cc271f (diff) | |
download | edk2-f56d52c7f581da4bb732ab6b456718ae59d39efa.tar.gz edk2-f56d52c7f581da4bb732ab6b456718ae59d39efa.tar.bz2 edk2-f56d52c7f581da4bb732ab6b456718ae59d39efa.zip |
BaseTools: explicitly import email.header PatchCheck.py
On Debian 10 (Buster), when running PatchCheck.py with python2, a
backtrace is printed, starting from:
File "../edk2/BaseTools/Scripts/PatchCheck.py", line 595,
in find_patch_pieces
parts = email.header.decode_header(pmail.get('subject'))
AttributeError: 'module' object has no attribute 'header'
When using python3, this backtrace does not appear.
Explicitly importing email.header resolves this for python2 and does not
appear to cause any issues with python3.
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Scripts')
-rwxr-xr-x | BaseTools/Scripts/PatchCheck.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 527761986d..52244b0bc4 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -20,6 +20,8 @@ import re import subprocess
import sys
+import email.header
+
class Verbose:
SILENT, ONELINE, NORMAL = range(3)
level = NORMAL
|