From: Tim Peters Date: Mon, 12 May 2003 19:29:36 +0000 (+0000) Subject: Close the file after tokenizing it. Because the open file object was X-Git-Tag: v2.3c1~749 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=11cb8135988ebe20631db08c60155d2a0b17c1b2;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index e3fbb15f869b..22a1d90afb00 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'