##// END OF EJS Templates
move the pandoc_available(...) call inside get_pandoc_version(...) as it also tested for availability
Daniel B. Vasquez -
Show More
@@ -113,8 +113,7 b" def pandoc(source, fmt, to, extra_args=None, encoding='utf-8'):"
113 113 if extra_args:
114 114 cmd.extend(extra_args)
115 115
116 # if pandoc is missing let the exception bubble us out of here
117 pandoc_available(failmode="raise", alt=cmd)
116 # this will raise an exception that will pop us out of here
118 117 check_pandoc_version()
119 118
120 119 # we can safely continue
@@ -134,11 +133,10 b' def get_pandoc_version():'
134 133 else:
135 134 return pandoc.version
136 135 except AttributeError:
136 # if pandoc is missing let the exception bubble us out of here
137 pandoc_available(failmode="raise")
137 138 cmd = ["pandoc", "-v"]
138 try:
139 139 out = subprocess.check_output(cmd, universal_newlines=True)
140 except OSError as e:
141 raise PandocMissing(cmd, e)
142 140 pv_re = re.compile(r'(\d{0,3}\.\d{0,3}\.\d{0,3})')
143 141 pandoc.version = pv_re.search(out).group(0)
144 142 return pandoc.version
General Comments 0
You need to be logged in to leave comments. Login now