Fix various missing import/unbound name errors.
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index a358210..2b73f54 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -127,7 +127,7 @@
                 if i == 20:
                     break
         except:
-            failOnException("iteration")
+            self.failOnException("iteration")
 
 test_classes.append(test__RandomNameSequence)