From 38b38d8affe9110968a5dc0cf91f4e566c1739a2 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Tue, 7 Mar 2017 20:47:53 +0900 Subject: [PATCH] Make flake8 stop complaining. --- sphinx/domains/cpp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index f4163cb37..9d697e3df 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -4499,7 +4499,7 @@ class CPPDomain(Domain): ast = parser.parse_xref_object() parser.assert_end() except DefinitionError as e: - def findWarning(): + def findWarning(e): # as arg to stop flake8 from complaining if typ != 'any' and typ != 'func': return target, e # hax on top of the paren hax to try to get correct errors @@ -4511,7 +4511,7 @@ class CPPDomain(Domain): return target[:-2], e2 # strange, that we don't get the error now, use the original return target, e - t, ex = findWarning() + t, ex = findWarning(e) warner.warn('Unparseable C++ cross-reference: %r\n%s' % (t, text_type(ex.description))) return None, None