Skip to content

Commit 7111c16

Browse files
Use a raw F string for regex in pandoc downloader (#371)
* Updated regex to hopefully not provide a regex syntax error on python 3.12 * We are now using a raw F string for the regex
1 parent 23f6f09 commit 7111c16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pypandoc/pandoc_download.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _get_pandoc_urls(version="latest"):
5858
# regex for the binaries
5959
uname = platform.uname()[4]
6060
processor_architecture = "arm" if uname.startswith("arm") or uname.startswith("aarch") else "amd"
61-
regex = re.compile(r"/jgm/pandoc/releases/download/.*(?:"+processor_architecture+"|x86|mac).*\\.(?:msi|deb|pkg)")
61+
regex = re.compile(fr"/jgm/pandoc/releases/download/.*(?:{processor_architecture}|x86|mac).*\.(?:msi|deb|pkg)")
6262
# a list of urls to the binaries
6363
pandoc_urls_list = regex.findall(content.decode("utf-8"))
6464
# actual pandoc version

0 commit comments

Comments
 (0)