@@ -136,7 +136,7 @@ class EditLayerForm(StyledModelForm):
def clean_summary(self):
# Compress whitespace and use only spaces
summary = self.cleaned_data['summary'].strip()
- summary = re.sub('\s+', ' ', summary)
+ summary = re.sub(r'\s+', ' ', summary)
return summary
def clean_layer_type(self):
@@ -278,7 +278,7 @@ class LayerBranch(models.Model):
url = base_url.replace('%branch%', branchname)
if path:
splitpath = path.split('/')
- for match in re.findall('(%pathelement\[([0-9]*)(:[0-9]*)?\]%)', url):
+ for match in re.findall(r'(%pathelement\[([0-9]*)(:[0-9]*)?\]%)', url):
if match[1] == '':
start = None
else:
@@ -528,7 +528,7 @@ def sanitise_html(html):
return soup.renderContents()
def squashspaces(string):
- return re.sub("\s+", " ", string).strip()
+ return re.sub(r"\s+", " ", string).strip()
def sha256_file(ifn):
import hashlib
Fix the "invalid escape sequence" DeprecationWarnings reported by the test suite in models.py, utils.py and forms.py. Python 3.12 turns these into SyntaxWarnings and a future release will make them errors. The patterns themselves are unchanged. AI-Generated: Claude Opus 5.5 Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- layerindex/forms.py | 2 +- layerindex/models.py | 2 +- layerindex/utils.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)