Skip to content

Commit 9f70723

Browse files
committed
fixed bug in Pandoc version checking for Pandoc 3.0 compatibility
1 parent 01c209d commit 9f70723

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

codebraid/converters/pandoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,8 +967,8 @@ def __init__(self, *,
967967
pandoc_version_match = re.search(rb'\d+\.\d+', proc.stdout)
968968
if not pandoc_version_match:
969969
raise RuntimeError('Could not determine Pandoc version from "{0} --version"; faulty Pandoc installation?'.format(pandoc_path))
970-
pandoc_version_major, pandoc_version_minor = (float(x) for x in pandoc_version_match.group().split(b'.', 1))
971-
if pandoc_version_major < 2 or pandoc_version_minor < 4:
970+
pandoc_version_major, pandoc_version_minor = (int(x) for x in pandoc_version_match.group().split(b'.', 1))
971+
if pandoc_version_major < 2 or (pandoc_version_major == 2 and pandoc_version_minor < 4):
972972
raise RuntimeError('Pandoc at "{0}" is version {1}.{2}, but >= 2.4 is required'.format(pandoc_path, pandoc_version_major, pandoc_version_minor))
973973
self.pandoc_path = pandoc_path
974974
if platform.system() == 'Windows':

0 commit comments

Comments
 (0)