Skip to content

Commit

Permalink
Fix for python3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasr8 committed Sep 4, 2024
1 parent 1ee6faa commit 6c21d2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion babel/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ def _split(self, text):
# There are no file names which contain spaces, fallback to the default implementation
return super()._split(text)

super_ = super() # Python 3.9 fix, super() does not work in list comprehension
chunks = re.split(self._enclosed_filename_re, text)
chunks = [[c] if c.startswith(enclosed_filename_start) else super()._split(c) for c in chunks]
chunks = [[c] if c.startswith(enclosed_filename_start) else super_._split(c) for c in chunks]
chunks = [c for c in chain.from_iterable(chunks) if c]
return chunks

Expand Down

0 comments on commit 6c21d2f

Please sign in to comment.