Skip to content

Commit

Permalink
Merge pull request #81 from VegarS/except-to-hasattr
Browse files Browse the repository at this point in the history
Avoid running app.exec() inside except block
  • Loading branch information
hosaka authored Jun 15, 2023
2 parents e000050 + 3efd0c2 commit 28c6599
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qasync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ def run_forever(self):
self.__log_debug("Starting Qt event loop")
asyncio.events._set_running_loop(self)
rslt = -1
try:
if hasattr(self.__app, 'exec_'):
rslt = self.__app.exec_()
except AttributeError:
else:
rslt = self.__app.exec()
self.__log_debug("Qt event loop ended with result %s", rslt)
return rslt
Expand Down

0 comments on commit 28c6599

Please sign in to comment.