doc: remove usage of sre_constants in filter-known-issues.py

sre_constants is an undocumented module that deprecated in python 3.11.
The sre_constants.error exception is also exposed through re.error,
this documented one should be used instead.

Tracked-On: #8425
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Jiaqing Zhao 2023-06-07 08:06:02 +00:00 committed by David Kinder
parent 24af8011c9
commit 0d9b08633d
1 changed files with 1 additions and 2 deletions

View File

@ -36,7 +36,6 @@ import logging
import mmap import mmap
import os import os
import re import re
import sre_constants
import sys import sys
import traceback import traceback
@ -69,7 +68,7 @@ def config_import_file(filename):
regex = gd['regex'] regex = gd['regex']
try: try:
r = re.compile(regex, re.MULTILINE) r = re.compile(regex, re.MULTILINE)
except sre_constants.error as e: except re.error as e:
logging.error("%s: bytes %d-%d: bad regex: %s", logging.error("%s: bytes %d-%d: bad regex: %s",
filename, m.start(), m.end(), e) filename, m.start(), m.end(), e)
raise raise