Mercurial > hg
comparison hgext/convert/monotone.py @ 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 | a916e8de4313 |
children | ce292f1379ba |
comparison
equal
deleted
inserted
replaced
14178:524c560e2d32 | 14179:64481eee6215 |
---|---|
25 norepo = NoRepo(_("%s does not look like a monotone repository") | 25 norepo = NoRepo(_("%s does not look like a monotone repository") |
26 % path) | 26 % path) |
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': |
34 raise norepo | 36 raise norepo |
35 | 37 |