##// END OF EJS Templates
config: close file even if we fail to read it...
Martin von Zweigbergk -
r44362:c41ed5d4 default
parent child Browse files
Show More
@@ -434,16 +434,16 b' class ui(object):'
434 return
434 return
435 raise
435 raise
436
436
437 with fp:
437 cfg = config.config()
438 cfg = config.config()
438 trusted = sections or trust or self._trusted(fp, filename)
439 trusted = sections or trust or self._trusted(fp, filename)
439
440
440 try:
441 try:
441 cfg.read(filename, fp, sections=sections, remap=remap)
442 cfg.read(filename, fp, sections=sections, remap=remap)
442 fp.close()
443 except error.ParseError as inst:
443 except error.ParseError as inst:
444 if trusted:
444 if trusted:
445 raise
445 raise
446 self.warn(_(b"ignored: %s\n") % stringutil.forcebytestr(inst))
446 self.warn(_(b'ignored: %s\n') % stringutil.forcebytestr(inst))
447
447
448 if self.plain():
448 if self.plain():
449 for k in (
449 for k in (
General Comments 0
You need to be logged in to leave comments. Login now