# HG changeset patch
# User Matt Mackall <mpm@selenic.com>
# Date 1304477593 18000
#      Tue May 03 21:53:13 2011 -0500
# Node ID 64481eee621559cdc024722d11d215ed2f8cd23e
# Parent  524c560e2d323196ab778d9b22029e9af2f32c37
hgext: fixup a couple missed file().read() instances

diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py
--- a/hgext/convert/monotone.py
+++ b/hgext/convert/monotone.py
@@ -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':
diff --git a/hgext/inotify/linuxserver.py b/hgext/inotify/linuxserver.py
--- a/hgext/inotify/linuxserver.py
+++ b/hgext/inotify/linuxserver.py
@@ -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