Fix #10258 - clean up resource warning

This commit is contained in:
Brian Curtin 2010-10-30 21:35:28 +00:00
parent 810921b675
commit 9f5f65c736

View file

@ -590,7 +590,9 @@ def roundtrip(f):
"""
if isinstance(f, str):
f = BytesIO(f.encode('utf-8'))
try:
token_list = list(tokenize(f.readline))
finally:
f.close()
tokens1 = [tok[:2] for tok in token_list]
new_bytes = untokenize(tokens1)