Skip to content
This repository was archived by the owner on Dec 30, 2020. It is now read-only.

Commit 7c9406b

Browse files
committed
Fix broken checks for missing pygments module
Since the module was imported outside the try the exception was never caught and correct fix message was not displayed
1 parent b10edae commit 7c9406b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

r2wiki.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
import pydoc
88
from argparse import ArgumentParser
99
from subprocess import Popen, PIPE
10-
from pygments import highlight
11-
from pygments.lexers import MarkdownLexer
12-
from pygments.formatters import TerminalFormatter
1310

1411
black_list = ['<p hidden>', '<!--', '<img src']
1512
src_dir = os.path.dirname(os.path.realpath(__file__))
@@ -56,7 +53,9 @@ def arg_parse():
5653
flags=re.IGNORECASE)
5754

5855
try:
59-
56+
from pygments import highlight
57+
from pygments.lexers import MarkdownLexer
58+
from pygments.formatters import TerminalFormatter
6059
found = ''
6160

6261
for path, subdirs, files in os.walk(src_dir):

0 commit comments

Comments
 (0)