_once():  Simplified dict manipulation.
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 32b83a0..dff2ae9 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -101,12 +101,12 @@
     lock = _once_lock
 
     # Check first outside the lock.
-    if var in vars and vars[var] is not None:
+    if vars.get(var) is not None:
         return
     try:
         lock.acquire()
         # Check again inside the lock.
-        if var in vars and vars[var] is not None:
+        if vars.get(var) is not None:
             return
         vars[var] = initializer()
     finally: