Merge pull request #7140 from tk0miya/7139_code_block_guess

Fix #7139: ``code-block:: guess`` does not work
This commit is contained in:
Takeshi KOMIYA
2020-02-14 01:01:22 +09:00
committed by GitHub
2 changed files with 2 additions and 6 deletions

View File

@@ -60,6 +60,7 @@ Bugs fixed
generated automatically in signatures.
* #5637: autodoc: Incorrect handling of nested class names on show-inheritance
* #5637: inheritance_diagram: Incorrect handling of nested class names
* #7139: ``code-block:: guess`` does not work
Testing
--------

View File

@@ -105,11 +105,6 @@ class PygmentsBridge:
lang = 'pycon3'
else:
lang = 'python3'
elif lang == 'guess':
try:
lexer = guess_lexer(source)
except Exception:
lexer = lexers['none']
if lang in lexers:
# just return custom lexers here (without installing raiseonerror filter)
@@ -119,7 +114,7 @@ class PygmentsBridge:
else:
try:
if lang == 'guess':
lexer = guess_lexer(lang, **opts)
lexer = guess_lexer(source, **opts)
else:
lexer = get_lexer_by_name(lang, **opts)
except ClassNotFound: