Skip to content

Commit

Permalink
Merge from 5.x: PR #21868
Browse files Browse the repository at this point in the history
Fixes #21861
  • Loading branch information
ccordoba12 committed Mar 12, 2024
2 parents f2e3a3a + f8f71e5 commit a3b1e61
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions spyder/plugins/updatemanager/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,18 @@ def start(self):
error_msg = HTTP_ERROR_MSG.format(status_code=page.status_code)
logger.warning(err, exc_info=err)
except Exception as err:
error = traceback.format_exc()
formatted_error = (
error.replace('\n', '<br>')
.replace(' ', '&nbsp;')
)

error_msg = _(
'It was not possible to check for Spyder updates due to the '
'following error:'
'<br><br>'
'<tt>{}</tt>'
).format(formatted_error)
# Only log the error when it's a generic one because we can't give
# users proper feedback on how to address it. Otherwise we'd show
# a long traceback that most probably would be incomprehensible to
# them.
logger.warning(err, exc_info=err)
finally:
self.error = error_msg

# At this point we **must** emit the signal below so that the
# "Check for updates" action in the Help menu is enabled again
# after the check has finished (it's disabled while the check is
# running).
try:
self.sig_ready.emit()
except RuntimeError:
Expand Down Expand Up @@ -287,6 +284,7 @@ def start(self):
self._clean_installer_path()
finally:
self.error = error_msg

try:
self.sig_ready.emit()
except RuntimeError:
Expand Down

0 comments on commit a3b1e61

Please sign in to comment.