Show More
@@ -47,9 +47,13 b" def pandoc(source, fmt, to, extra_args=None, encoding='utf-8'):" | |||
|
47 | 47 | command = ['pandoc', '-f', fmt, '-t', to] |
|
48 | 48 | if extra_args: |
|
49 | 49 | command.extend(extra_args) |
|
50 | p = subprocess.Popen(command, | |
|
51 | stdin=subprocess.PIPE, stdout=subprocess.PIPE | |
|
52 | ) | |
|
50 | try: | |
|
51 | p = subprocess.Popen(command, | |
|
52 | stdin=subprocess.PIPE, stdout=subprocess.PIPE | |
|
53 | ) | |
|
54 | except OSError: | |
|
55 | sys.exit("ERROR: Unable to launch pandoc. Please install pandoc:\n" | |
|
56 | "(http://johnmacfarlane.net/pandoc/installing.html)") | |
|
53 | 57 | out, _ = p.communicate(cast_bytes(source, encoding)) |
|
54 | 58 | out = out.decode(encoding, 'replace') |
|
55 | 59 | return out[:-1] |
General Comments 0
You need to be logged in to leave comments.
Login now