diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2008-03-24 06:10:13 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-03-24 06:10:13 (GMT) |
commit | 2595e7606c62486405f69c04ef21e6af8bbd9a04 (patch) | |
tree | 9e1303c4ff74eb245f17b000b79c8c7242b8ba19 /Lib/test/test_fileinput.py | |
parent | 64018ae0572044af8817a7096977792c0935ba7c (diff) | |
download | cpython-2595e7606c62486405f69c04ef21e6af8bbd9a04.zip cpython-2595e7606c62486405f69c04ef21e6af8bbd9a04.tar.gz cpython-2595e7606c62486405f69c04ef21e6af8bbd9a04.tar.bz2 |
Ensure cleanup does not reference variables that don't yet exist.
Diffstat (limited to 'Lib/test/test_fileinput.py')
-rw-r--r-- | Lib/test/test_fileinput.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index aa38527..76a41a6 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -34,6 +34,7 @@ class BufferSizesTests(unittest.TestCase): def test_buffer_sizes(self): # First, run the tests with default and teeny buffer size. for round, bs in (0, 0), (1, 30): + t1 = t2 = t3 = t4 = None try: t1 = writeTmp(1, ["Line %s of file 1\n" % (i+1) for i in range(15)]) t2 = writeTmp(2, ["Line %s of file 2\n" % (i+1) for i in range(10)]) @@ -122,6 +123,7 @@ class BufferSizesTests(unittest.TestCase): class FileInputTests(unittest.TestCase): def test_zero_byte_files(self): + t1 = t2 = t3 = t4 = None try: t1 = writeTmp(1, [""]) t2 = writeTmp(2, [""]) @@ -145,6 +147,7 @@ class FileInputTests(unittest.TestCase): remove_tempfiles(t1, t2, t3, t4) def test_files_that_dont_end_with_newline(self): + t1 = t2 = None try: t1 = writeTmp(1, ["A\nB\nC"]) t2 = writeTmp(2, ["D\nE\nF"]) @@ -171,6 +174,7 @@ class FileInputTests(unittest.TestCase): ## remove_tempfiles(t1) def test_fileno(self): + t1 = t2 = None try: t1 = writeTmp(1, ["A\nB"]) t2 = writeTmp(2, ["C\nD"]) |