diff options
author | Joey Vagedes <joey.vagedes@gmail.com> | 2023-12-29 00:47:39 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-01-10 13:54:01 +0000 |
commit | 6c488a2f390d6aacb605b6c370fbe6cc275af4fd (patch) | |
tree | 1de62087597a89e7ca795da0a0403ba21e18caf0 /BaseTools/Source/Python/Common | |
parent | 7d055812cc7a7d2b062cf56291211e8cecca36ed (diff) | |
download | edk2-6c488a2f390d6aacb605b6c370fbe6cc275af4fd.tar.gz edk2-6c488a2f390d6aacb605b6c370fbe6cc275af4fd.tar.bz2 edk2-6c488a2f390d6aacb605b6c370fbe6cc275af4fd.zip |
BaseTools: Fix raw strings containing valid escape characters
Fixes raw regex strings that contain valid (and purposeful) escape
characters as they are being treated as individual characters rather
than the single escaped character they represent (i.e. '\t' is being
treated as a '\' and a 't' rather than a single tab character).
Signed-off-by: Joey Vagedes <joey.vagedes@gmail.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'BaseTools/Source/Python/Common')
-rwxr-xr-x | BaseTools/Source/Python/Common/Misc.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index f87d9dbdba..34bfc90abd 100755 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1926,4 +1926,4 @@ def CopyDict(ori_dict): # Remove the c/c++ comments: // and /* */
#
def RemoveCComments(ctext):
- return re.sub(r'//.*?\n|/\*.*?\*/', '\n', ctext, flags=re.S)
+ return re.sub('//.*?\n|/\\*.*?\\*/', '\n', ctext, flags=re.S)
|