Page MenuHomeLubuntu Development

Fix UnboundLocalError in automirror module
ClosedPublic

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

Details

Summary

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 "https://ipapi.co/json"

Diff Detail

Repository
rCALASETTINGS Ubuntu Calamares Settings
Branch
master
Lint
No Linters Available
Unit
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, 5:03 AM
apt-ghetto created this revision.
wxl accepted this revision.Sep 8 2019, 12: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, 12:57 PM
kc2bez accepted this revision.Sep 8 2019, 5:29 PM

Thanks for picking up on this. LGTM

This revision was automatically updated to reflect the committed changes.