scripts: Fix string pattern on byte like objects error
This patch fixes following error of python script. TypeError: cannot use a string pattern on a bytes-like object Jira: ZEP-2290 Signed-off-by: Punit Vara <punit.vara@intel.com>
This commit is contained in:
parent
63174efa7b
commit
a4eaf6e80c
2 changed files with 5 additions and 4 deletions
|
@ -52,7 +52,8 @@ build:
|
||||||
echo "- Building Documentation";
|
echo "- Building Documentation";
|
||||||
echo "Commit range:" ${COMMIT_RANGE}
|
echo "Commit range:" ${COMMIT_RANGE}
|
||||||
make htmldocs > doc.log 2>&1;
|
make htmldocs > doc.log 2>&1;
|
||||||
python2 ./scripts/filter-known-issues.py --config-dir .known-issues/doc/ doc.log > doc.warnings;
|
./scripts/filter-known-issues.py --config-dir .known-issues/doc/ doc.log > doc.warnings;
|
||||||
|
|
||||||
if [ "$?" != 0 ]; then
|
if [ "$?" != 0 ]; then
|
||||||
echo " ==> Error running filter script"
|
echo " ==> Error running filter script"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -43,8 +43,8 @@ exclude_regexs = []
|
||||||
# first is a list of one or more comment lines
|
# first is a list of one or more comment lines
|
||||||
# followed by a list of non-comments which describe a multiline regex
|
# followed by a list of non-comments which describe a multiline regex
|
||||||
config_regex = \
|
config_regex = \
|
||||||
"(?P<comment>(^\s*#.*\n)+)" \
|
b"(?P<comment>(^\s*#.*\n)+)" \
|
||||||
"(?P<regex>(^[^#].*\n)+)"
|
b"(?P<regex>(^[^#].*\n)+)"
|
||||||
|
|
||||||
def config_import_file(filename):
|
def config_import_file(filename):
|
||||||
"""
|
"""
|
||||||
|
@ -72,7 +72,7 @@ def config_import_file(filename):
|
||||||
raise
|
raise
|
||||||
logging.debug("%s: found regex at bytes %d-%d: %s",
|
logging.debug("%s: found regex at bytes %d-%d: %s",
|
||||||
filename, m.start(), m.end(), regex)
|
filename, m.start(), m.end(), regex)
|
||||||
if '#WARNING' in comment:
|
if b'#WARNING' in comment:
|
||||||
exclude_regexs.append((r, origin, ('warning',)))
|
exclude_regexs.append((r, origin, ('warning',)))
|
||||||
else:
|
else:
|
||||||
exclude_regexs.append((r, origin, ()))
|
exclude_regexs.append((r, origin, ()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue