예제 #1
0
 def infer_first(node):
     try:
         value = next(node.infer(context=context))
         if value is YES:
             raise UseInferenceDefault()
         else:
             return value
     except StopIteration:
         raise InferenceError()
예제 #2
0
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()