--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgClient.py Tue Apr 13 17:49:05 2021 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgClient.py Tue Apr 13 18:02:59 2021 +0200 @@ -370,19 +370,14 @@ inputChannels = {} if prompt is not None: def func(size): - if outputBuffer is None: - msg = "" - else: - msg = outputBuffer.getvalue() + msg = "" if outputBuffer is None else outputBuffer.getvalue() reply, isPassword = prompt(size, msg) return reply, isPassword inputChannels["L"] = func else: def myprompt(size): - if outputBuffer is None: - msg = self.tr("For message see output dialog.") - else: - msg = outputBuffer.getvalue() + msg = (self.tr("For message see output dialog.") + if outputBuffer is None else outputBuffer.getvalue()) reply, isPassword = self.__prompt(size, msg) return reply, isPassword inputChannels["L"] = myprompt @@ -391,14 +386,9 @@ self.__cancel = False self.__runcommand(args, inputChannels, outputChannels) - if outputBuffer: - out = outputBuffer.getvalue() - else: - out = "" - if errorBuffer: - err = errorBuffer.getvalue() - else: - err = "" + + out = outputBuffer.getvalue() if outputBuffer else "" + err = errorBuffer.getvalue() if errorBuffer else "" self.__commandRunning = False