mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
[systray] refactoring: replacing 'try/except' by 'with' block
This commit is contained in:
@@ -79,14 +79,11 @@ class UpdateCheck(QThread):
|
|||||||
self.logger = logger
|
self.logger = logger
|
||||||
|
|
||||||
def _notify_updates(self):
|
def _notify_updates(self):
|
||||||
self.lock.acquire()
|
with self.lock:
|
||||||
try:
|
|
||||||
updates = list_updates(self.logger)
|
updates = list_updates(self.logger)
|
||||||
|
|
||||||
if updates is not None:
|
if updates is not None:
|
||||||
self.signal.emit(updates)
|
self.signal.emit(updates)
|
||||||
finally:
|
|
||||||
self.lock.release()
|
|
||||||
|
|
||||||
self.sleep(self.check_interval)
|
self.sleep(self.check_interval)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user