summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2009-05-28 06:09:08 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2009-05-28 06:09:08 (GMT)
commita27c5bd2bd09da1239f038cccf89cbbba32933ab (patch)
tree1f5136ab5dfd243fe2d39f4a21b7353f7750f362 /Lib/test/test_inspect.py
parent3d2dc35a2847ce89aee31889253fb52b7c5e26a0 (diff)
downloadcpython-a27c5bd2bd09da1239f038cccf89cbbba32933ab.zip
cpython-a27c5bd2bd09da1239f038cccf89cbbba32933ab.tar.gz
cpython-a27c5bd2bd09da1239f038cccf89cbbba32933ab.tar.bz2
Merged revisions 72979 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72979 | philip.jenvey | 2009-05-27 22:58:44 -0700 (Wed, 27 May 2009) | 2 lines explicitly close files ........
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 26ec953..37be205 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -175,7 +175,8 @@ class GetSourceBase(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
- self.source = open(inspect.getsourcefile(self.fodderFile)).read()
+ with open(inspect.getsourcefile(self.fodderFile)) as fp:
+ self.source = fp.read()
def sourcerange(self, top, bottom):
lines = self.source.split("\n")