def infer_first(node): try: value = next(node.infer(context=context)) if value is YES: raise UseInferenceDefault() else: return value except StopIteration: raise InferenceError()
def _infer_first(node, context): if node is util.Uninferable: raise UseInferenceDefault try: value = next(node.infer(context=context)) if value is util.Uninferable: raise UseInferenceDefault() else: return value except StopIteration: raise InferenceError()