Skip to content

Commit

Permalink
Merge pull request #49 from plone/maurits-regexp-311
Browse files Browse the repository at this point in the history
Fixed regular expression in tests on Python 3.11.
  • Loading branch information
davisagli authored Oct 27, 2022
2 parents f9bc179 + e27aac9 commit e73e91f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Products/PortalTransforms/tests/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class HtmlToText(BaseTransform):
output = 'text/plain'

def __call__(self, orig, **kwargs):
orig = re.sub('<[^>]*>(?i)(?m)', '', orig)
return urllib.parse.unquote(re.sub('\n+', '\n', orig)).strip()
orig = re.sub(r'(?i)(?m)<[^>]*>', '', orig)
return urllib.parse.unquote(re.sub(r'\n+', '\n', orig)).strip()

def convert(self, orig, data, **kwargs):
orig = self.__call__(orig)
Expand All @@ -42,7 +42,7 @@ class FooToBar(BaseTransform):

def __call__(self, orig, **kwargs):
orig = re.sub('foo', 'bar', orig)
return urllib.parse.unquote(re.sub('\n+', '\n', orig)).strip()
return urllib.parse.unquote(re.sub(r'\n+', '\n', orig)).strip()

def convert(self, orig, data, **kwargs):
orig = self.__call__(orig)
Expand Down
2 changes: 2 additions & 0 deletions news/48.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed regular expression in tests on Python 3.11.
[maurits]

0 comments on commit e73e91f

Please sign in to comment.