Backport issue 4597 to python 2.5.3: Fixed several opcodes that weren't always
propagating exceptions.
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 0a8114a..ba6ea47 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -341,6 +341,20 @@
         finally:
             sys.stdout = save_stdout
 
+    def test_del_stdout_before_print(self):
+        # Issue 4597: 'print' with no argument wasn't reporting when
+        # sys.stdout was deleted.
+        save_stdout = sys.stdout
+        del sys.stdout
+        try:
+            print
+        except RuntimeError, e:
+            self.assertEquals(str(e), "lost sys.stdout")
+        else:
+            self.fail("Expected RuntimeError")
+        finally:
+            sys.stdout = save_stdout
+
 
 def test_main():
     # Historically, these tests have been sloppy about removing TESTFN.