Fix wrong variable name.
diff --git a/Lib/warnings.py b/Lib/warnings.py
index fd944ed..06d7685 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -79,7 +79,7 @@
         action, msg, cat, mod, ln = item
         if ((msg is None or msg.match(text)) and
             issubclass(category, cat) and
-            (msg is None or mod.match(module)) and
+            (mod is None or mod.match(module)) and
             (ln == 0 or lineno == ln)):
             break
     else: