mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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 ........
This commit is contained in:
parent
3d2dc35a28
commit
a27c5bd2bd
3 changed files with 29 additions and 30 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue