def _except_import_error(node):
 if (not isinstance(node, astroid.TryExcept)):
  return
 return any(map(is_import_error, node.handlers))

def _except_import_error ( node ) : if ( not isinstance ( node , astroid . TryExcept ) ) : return return any ( map ( is_import_error , node . handlers ) )
check if the try-except node has an importerror handler .