The software updater recognizes when it needs to restart and sets the restartme variable that is local to main(). The problem is that some exceptions can be passed up from main to the loop that exists in global scope in the if __name__ == '__main__': block. That loop that's in the global scope catches all exceptions and calls main() again.
The problem is that, in the unfortunate event of such an exception occurring between the time of recognizing that a restart needs to be done and a successful restart happening, the software updater forgets that it wanted to restart itself because the restartme variable was local to main.
The solution would seem to be to make restartme global.
Note to self: don't forget the global keyword when fixing this.
The software updater recognizes when it needs to restart and sets the
restartme
variable that is local to main(). The problem is that some exceptions can be passed up from main to the loop that exists in global scope in theif __name__ == '__main__':
block. That loop that's in the global scope catches all exceptions and calls main() again.The problem is that, in the unfortunate event of such an exception occurring between the time of recognizing that a restart needs to be done and a successful restart happening, the software updater forgets that it wanted to restart itself because the
restartme
variable was local to main.The solution would seem to be to make
restartme
global.Note to self: don't forget the
global
keyword when fixing this.