fix usage of undefined name (#25504)
diff --git a/Tools/freeze/checkextensions_win32.py b/Tools/freeze/checkextensions_win32.py
index 8c6444c..10f199c 100644
--- a/Tools/freeze/checkextensions_win32.py
+++ b/Tools/freeze/checkextensions_win32.py
@@ -118,7 +118,7 @@
 
     for exc in exclude:
         if exc in module.sourceFiles:
-            modules.sourceFiles.remove(exc)
+            module.sourceFiles.remove(exc)
 
     return module