Mercurial > hg-stable
changeset 14179:64481eee6215
hgext: fixup a couple missed file().read() instances
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 03 May 2011 21:53:13 -0500 |
parents | 524c560e2d32 |
children | 1123bbba278d |
files | hgext/convert/monotone.py hgext/inotify/linuxserver.py |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/convert/monotone.py Tue May 03 22:11:56 2011 +0200 +++ b/hgext/convert/monotone.py Tue May 03 21:53:13 2011 -0500 @@ -27,7 +27,9 @@ if not os.path.exists(os.path.join(path, '_MTN')): # Could be a monotone repository (SQLite db file) try: - header = file(path, 'rb').read(16) + f = file(path, 'rb') + header = f.read(16) + f.close() except: header = '' if header != 'SQLite format 3\x00':
--- a/hgext/inotify/linuxserver.py Tue May 03 22:11:56 2011 +0200 +++ b/hgext/inotify/linuxserver.py Tue May 03 21:53:13 2011 -0500 @@ -44,7 +44,7 @@ def _explain_watch_limit(ui, dirstate, rootabs): path = '/proc/sys/fs/inotify/max_user_watches' try: - limit = int(file(path).read()) + limit = int(util.readfile(path)) except IOError, err: if err.errno != errno.ENOENT: raise