--- a/eric6/Plugins/VcsPlugins/vcsGit/ConfigurationPage/GitPage.py Wed Apr 14 19:38:19 2021 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsGit/ConfigurationPage/GitPage.py Wed Apr 14 19:59:16 2021 +0200 @@ -9,6 +9,7 @@ """ import os +import contextlib from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QDialog @@ -93,13 +94,9 @@ else: firstName, lastName, email = ( "Firstname", "Lastname", "email_address") - try: - with open(cfgFile, "w") as f: - f.write("[user]\n") - f.write(" name = {0} {1}\n".format(firstName, lastName)) - f.write(" email = {0}\n".format(email)) - except OSError: - # ignore these - pass + with contextlib.suppress(OSError), open(cfgFile, "w") as f: + f.write("[user]\n") + f.write(" name = {0} {1}\n".format(firstName, lastName)) + f.write(" email = {0}\n".format(email)) editor = MiniEditor(cfgFile, "Properties", self) editor.show()