mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Close the file after tokenizing it. Because the open file object was
bound to a module global, the file object remained opened throughout the test suite run.
This commit is contained in:
parent
12d55a7caa
commit
11cb813598
1 changed files with 5 additions and 2 deletions
|
|
@ -3,7 +3,10 @@ import tokenize, os, sys
|
|||
|
||||
if verbose:
|
||||
print 'starting...'
|
||||
file = open(findfile('tokenize_tests'+os.extsep+'py'))
|
||||
tokenize.tokenize(file.readline)
|
||||
|
||||
f = file(findfile('tokenize_tests'+os.extsep+'py'))
|
||||
tokenize.tokenize(f.readline)
|
||||
f.close()
|
||||
|
||||
if verbose:
|
||||
print 'finished'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue