diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-05-12 19:29:36 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-05-12 19:29:36 (GMT) |
commit | 11cb8135988ebe20631db08c60155d2a0b17c1b2 (patch) | |
tree | bbcf559a0e7262c7b3b139576bb84f53682954f6 /Lib/test/test_tokenize.py | |
parent | 12d55a7caaf58e7219f7c2bfa796ab19246640dd (diff) | |
download | cpython-11cb8135988ebe20631db08c60155d2a0b17c1b2.zip cpython-11cb8135988ebe20631db08c60155d2a0b17c1b2.tar.gz cpython-11cb8135988ebe20631db08c60155d2a0b17c1b2.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_tokenize.py')
-rw-r--r-- | Lib/test/test_tokenize.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index e3fbb15..22a1d90 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -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' |