~ubuntu-branches/ubuntu/maverick/python2.7/maverick-proposed

« back to all changes in this revision

Viewing changes to Lib/test/list_tests.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-06-29 00:57:00 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100629005700-fz6zs37e3uv26o82
Tags: 2.7~rc2-1
* Python 2.7 release candidate 2.
* Update to 20100628, taken from the trunk.
* Merge packaging changes from python2.6 (2.6.5+20100628-1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        d.append(d)
58
58
        d.append(400)
59
59
        try:
60
 
            fo = open(test_support.TESTFN, "wb")
61
 
            print >> fo, d,
62
 
            fo.close()
63
 
            fo = open(test_support.TESTFN, "rb")
64
 
            self.assertEqual(fo.read(), repr(d))
 
60
            with open(test_support.TESTFN, "wb") as fo:
 
61
                print >> fo, d,
 
62
            with open(test_support.TESTFN, "rb") as fo:
 
63
                self.assertEqual(fo.read(), repr(d))
65
64
        finally:
66
 
            fo.close()
67
65
            os.remove(test_support.TESTFN)
68
66
 
69
67
    def test_set_subscript(self):