mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-06-05 21:15:09 +00:00
Modernize usage of re.sub deprecated in Python 3.13
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -143,7 +143,7 @@ class TextChangelogFormat(ChangelogFormat):
|
||||
|
||||
@classmethod
|
||||
def version_title_text(cls, version_title):
|
||||
return re.sub(r'\n.*', version_title, re.DOTALL)
|
||||
return re.sub(r'\n.*', version_title, flags=re.DOTALL)
|
||||
|
||||
_category_title_re = re.compile(r'(^\w.*)\n+', re.MULTILINE)
|
||||
@classmethod
|
||||
|
||||
@@ -762,7 +762,7 @@ def escaped_split(inp_str, split_char):
|
||||
raise ValueError('Expected split character. Found string!')
|
||||
out = re.sub(r'(\\.)|' + split_char,
|
||||
lambda m: m.group(1) or '\n', inp_str,
|
||||
len(inp_str)).split('\n')
|
||||
count=len(inp_str)).split('\n')
|
||||
out = [x for x in out if x]
|
||||
return out
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ class Base:
|
||||
"""Preprocessor symbol used as a guard against multiple inclusion."""
|
||||
# Heuristic to strip irrelevant leading directories
|
||||
filename = re.sub(r'.*include[\\/]', r'', filename)
|
||||
return re.sub(r'[^0-9A-Za-z]', r'_', filename, re.A).upper()
|
||||
return re.sub(r'[^0-9A-Za-z]', r'_', filename, flags=re.A).upper()
|
||||
|
||||
def write_h_file(self, filename: str) -> None:
|
||||
"""Output a header file with function wrapper declarations and macro definitions."""
|
||||
|
||||
Reference in New Issue
Block a user