comparison mercurial/config.py @ 43346:6ada8a274b9c stable

formatting: run black version 19.10b0 on the codebase The latest version of black is out and contains the change we needed. So we can start using it now. note: `test-check-format.t` will complains about this changes because it still use `grey` and need to be migrated to `black`. See next changesets for this.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 29 Oct 2019 10:41:30 +0100
parents d201a637c971
children 9f70512ae2cf
comparison
equal deleted inserted replaced
43345:dc3fe251de72 43346:6ada8a274b9c
210 raise error.ParseError(l.rstrip(), (b"%s:%d" % (src, line))) 210 raise error.ParseError(l.rstrip(), (b"%s:%d" % (src, line)))
211 211
212 def read(self, path, fp=None, sections=None, remap=None): 212 def read(self, path, fp=None, sections=None, remap=None):
213 if not fp: 213 if not fp:
214 fp = util.posixfile(path, b'rb') 214 fp = util.posixfile(path, b'rb')
215 assert ( 215 assert getattr(fp, 'mode', r'rb') == r'rb', (
216 getattr(fp, 'mode', r'rb') == r'rb' 216 b'config files must be opened in binary mode, got fp=%r mode=%r'
217 ), b'config files must be opened in binary mode, got fp=%r mode=%r' % ( 217 % (fp, fp.mode,)
218 fp,
219 fp.mode,
220 ) 218 )
221 self.parse( 219 self.parse(
222 path, fp.read(), sections=sections, remap=remap, include=self.read 220 path, fp.read(), sections=sections, remap=remap, include=self.read
223 ) 221 )
224 222