Page MenuHomeLubuntu Development

Fix UnboundLocalError in automirror module

Authored by apt-ghetto on Sep 8 2019, 10:03 AM.



When opening an URL, an error may be raised and the wrong, not defined variable was logged.

Test Plan

Create an HTTPError or an URLError (socket.timeout), when opening ""

Diff Detail

rCALASETTINGS Ubuntu Calamares Settings
No Linters Available
No Unit Test Coverage
Build Status
Buildable 94
Build 94: arc lint + arc unit

Event Timeline

apt-ghetto requested review of this revision.Sep 8 2019, 10:03 AM
apt-ghetto created this revision.
wxl accepted this revision.Sep 8 2019, 5:57 PM

Nice catch. To be fair, there's a lot of url and error variables thrown around that aren't the same and this makes the code really unreadable and unmaintainable. If you wanted to go ahead and fix that, using, e.g. httperror instead of error for the HTTPError exception, that would be an added plus.

This revision is now accepted and ready to land.Sep 8 2019, 5:57 PM
kc2bez accepted this revision.Sep 8 2019, 10:29 PM

Thanks for picking up on this. LGTM

This revision was automatically updated to reflect the committed changes.