This is an archive of the discontinued Mercurial Phabricator instance.

config: close file even if we fail to read it
ClosedPublic

Authored by martinvonz on Dec 12 2019, 6:44 PM.

Details

Summary

If we get an exception from cfg.read(), we would not close the file
before this patch. This patch uses a context manager to make sure we
close it.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.