Skip to content

Commit

Permalink
Fix SyntaxError warning in regexp after Python 3.12
Browse files Browse the repository at this point in the history
Python 3.12 is stricter about regular expression: as the character `?` has no special meaning within squared brackets, escaping it is ambiguous.
  • Loading branch information
pcorpet authored Feb 9, 2025
1 parent 7bcaebf commit 11e89c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymrio/tools/ioutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def filename_from_url(url):
The extracted file name
"""
name = re.search("[^/\\&\?]+\.\w{2,7}(?=([\?&].*$|$))", url)
name = re.search("[^/\\&?]+\.\w{2,7}(?=([\?&].*$|$))", url)
return name.group()


Expand Down

0 comments on commit 11e89c0

Please sign in to comment.