Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 52581:cc918741a22a
ui: replace a trivial file read with the `util` function
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 17 Dec 2024 01:39:33 -0500 |
parents | 8986a3a8147a |
children | 24ee91ba9aa8 |
comparison
equal
deleted
inserted
replaced
52580:f4d1f0713b49 | 52581:cc918741a22a |
---|---|
2005 onerr=error.CanceledError, | 2005 onerr=error.CanceledError, |
2006 errprefix=_(b"edit failed"), | 2006 errprefix=_(b"edit failed"), |
2007 blockedtag=b'editor', | 2007 blockedtag=b'editor', |
2008 ) | 2008 ) |
2009 | 2009 |
2010 with open(name, 'rb') as f: | 2010 t = util.fromnativeeol(util.readfile(name)) |
2011 t = util.fromnativeeol(f.read()) | |
2012 finally: | 2011 finally: |
2013 os.unlink(name) | 2012 os.unlink(name) |
2014 | 2013 |
2015 return t | 2014 return t |
2016 | 2015 |