Make flake8 stop complaining.

This commit is contained in:
Jakob Lykke Andersen 2017-03-07 20:47:53 +09:00
parent bc527c533e
commit 38b38d8aff

View File

@ -4499,7 +4499,7 @@ class CPPDomain(Domain):
ast = parser.parse_xref_object() ast = parser.parse_xref_object()
parser.assert_end() parser.assert_end()
except DefinitionError as e: except DefinitionError as e:
def findWarning(): def findWarning(e): # as arg to stop flake8 from complaining
if typ != 'any' and typ != 'func': if typ != 'any' and typ != 'func':
return target, e return target, e
# hax on top of the paren hax to try to get correct errors # hax on top of the paren hax to try to get correct errors
@ -4511,7 +4511,7 @@ class CPPDomain(Domain):
return target[:-2], e2 return target[:-2], e2
# strange, that we don't get the error now, use the original # strange, that we don't get the error now, use the original
return target, e return target, e
t, ex = findWarning() t, ex = findWarning(e)
warner.warn('Unparseable C++ cross-reference: %r\n%s' warner.warn('Unparseable C++ cross-reference: %r\n%s'
% (t, text_type(ex.description))) % (t, text_type(ex.description)))
return None, None return None, None