unparser: Ignore type errors for Python-2-only constructs
This commit is contained in:
parent
af3a165a20
commit
7238ab94f5
@ -413,6 +413,7 @@ def visit_Try(self, node):
|
||||
self.dispatch(node.finalbody)
|
||||
|
||||
def visit_TryExcept(self, node):
|
||||
# this construct only exists in Python < 3.3
|
||||
self.fill("try")
|
||||
with self.block():
|
||||
self.dispatch(node.body)
|
||||
@ -425,7 +426,8 @@ def visit_TryExcept(self, node):
|
||||
self.dispatch(node.orelse)
|
||||
|
||||
def visit_TryFinally(self, node):
|
||||
if len(node.body) == 1 and isinstance(node.body[0], ast.TryExcept):
|
||||
# this construct only exists in Python < 3.3
|
||||
if len(node.body) == 1 and isinstance(node.body[0], ast.TryExcept): # type: ignore
|
||||
# try-except-finally
|
||||
self.dispatch(node.body)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user