From 1aa3eddeadf5b2cb5a1eaabd16551b32aa164d59 Mon Sep 17 00:00:00 2001 From: milde Date: Mon, 20 Apr 2015 14:05:27 +0000 Subject: Safe import of "pygments": syntax errors with Py 3.1 and 3.2. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7884 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/utils/code_analyzer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docutils/utils/code_analyzer.py') diff --git a/docutils/utils/code_analyzer.py b/docutils/utils/code_analyzer.py index 18c2c1ecf..5df203e54 100644 --- a/docutils/utils/code_analyzer.py +++ b/docutils/utils/code_analyzer.py @@ -13,7 +13,7 @@ try: from pygments.lexers import get_lexer_by_name from pygments.formatters.html import _get_ttype_class with_pygments = True -except ImportError: +except (ImportError, SyntaxError): # pygments 2.0.1 fails with Py 3.1 and 3.2 with_pygments = False # Filter the following token types from the list of class arguments: -- cgit v1.2.1