Skip to content

Commit

Permalink
dont use hasattr for checking presence of attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
heartsucker committed Apr 18, 2019
1 parent 7a9ed83 commit c0a0ccd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion securedrop/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def init_app(self, app):
self.__app = app
self.__app.config.setdefault('RQ_WORKER_NAME', 'default')

if not hasattr(self.__app, 'extensions'):
try:
# check for presence of existing extension dict
self.__app.extensions
except AttributeError:
self.__app.extensions = {}

queue_name = self.__app.config['RQ_WORKER_NAME']
Expand Down

0 comments on commit c0a0ccd

Please sign in to comment.