From 9eda1b90ecef88d7c079e24445cedd1a04e597f0 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Sat, 14 Jan 2012 13:21:07 -0500 Subject: Fix borked attempt to close a string (instead of the file it was read from). Corrects fccffe9c468ec652e07c13991cb340e76e82166d. --- pyramid/fixers/fix_bfg_imports.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyramid/fixers/fix_bfg_imports.py b/pyramid/fixers/fix_bfg_imports.py index d9a4a6dfb..0046aad30 100644 --- a/pyramid/fixers/fix_bfg_imports.py +++ b/pyramid/fixers/fix_bfg_imports.py @@ -190,7 +190,9 @@ def fix_zcml(path): for file in files: if file.endswith('.zcml'): absfile = os.path.join(root, file) - text = open(absfile, 'rb').read() + f = open(absfile, 'rb') + text = f.read() + f.close() newt = NS.sub('xmlns="http://pylonshq.com/pyramid"', text) newt = INCLUDE_ATTR.sub('pyramid_zcml', newt) newt = ATTR.sub(replace, newt) @@ -199,7 +201,6 @@ def fix_zcml(path): newf.write(newt) newf.flush() newf.close() - text.close() for dir in dirs: if dir.startswith('.'): -- cgit v1.2.3