##// END OF EJS Templates
hgext: fixup a couple missed file().read() instances
Matt Mackall -
r14179:64481eee default
parent child Browse files
Show More
@@ -27,7 +27,9 class monotone_source(converter_source,
27 if not os.path.exists(os.path.join(path, '_MTN')):
27 if not os.path.exists(os.path.join(path, '_MTN')):
28 # Could be a monotone repository (SQLite db file)
28 # Could be a monotone repository (SQLite db file)
29 try:
29 try:
30 header = file(path, 'rb').read(16)
30 f = file(path, 'rb')
31 header = f.read(16)
32 f.close()
31 except:
33 except:
32 header = ''
34 header = ''
33 if header != 'SQLite format 3\x00':
35 if header != 'SQLite format 3\x00':
@@ -44,7 +44,7 def walkrepodirs(dirstate, absroot):
44 def _explain_watch_limit(ui, dirstate, rootabs):
44 def _explain_watch_limit(ui, dirstate, rootabs):
45 path = '/proc/sys/fs/inotify/max_user_watches'
45 path = '/proc/sys/fs/inotify/max_user_watches'
46 try:
46 try:
47 limit = int(file(path).read())
47 limit = int(util.readfile(path))
48 except IOError, err:
48 except IOError, err:
49 if err.errno != errno.ENOENT:
49 if err.errno != errno.ENOENT:
50 raise
50 raise
General Comments 0
You need to be logged in to leave comments. Login now