Permalink
Browse files

Fix borked attempt to close a string (instead of the file it was read…

… from).

Corrects fccffe9.
  • Loading branch information...
1 parent 2648402 commit 9eda1b90ecef88d7c079e24445cedd1a04e597f0 @tseaver tseaver committed Jan 14, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 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('.'):

0 comments on commit 9eda1b9

Please sign in to comment.