diff --git a/astroid/inference.py b/astroid/inference.py
index <HASH>..<HASH> 100644
--- a/astroid/inference.py
+++ b/astroid/inference.py
@@ -312,7 +312,11 @@ def _infer_boolop(self, context=None):
     node.
     """
     values = self.values
-    op = self.op
+    if self.op == 'or':
+        predicate = operator.truth
+    else:
+        predicate = operator.not_
+
     try:
         values = [value.infer(context=context) for value in values]
     except InferenceError:
@@ -331,11 +335,6 @@ def _infer_boolop(self, context=None):
             yield YES
             continue
 
-        if op == 'or':
-            predicate = operator.truth
-        else:
-            predicate = operator.not_
-
         # Since the boolean operations are short circuited operations,
         # this code yields the first value for which the predicate is True
         # and if no value respected the predicate, then the last value will
Move the choosing of the predicate at the beginning of the function.