diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-08-02 08:49:53 -0700 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2018-08-02 20:33:47 +0100 |
commit | ff2d3249c8c0490b3b46803bac951ede09e09a0e (patch) | |
tree | b54a12508d266a45d059d21d49d1222f07bed48c /alot/commands/globals.py | |
parent | 4ca7f9ffce68d737642071f5dffaa78a738d8520 (diff) |
commands/globals: use getattr/setattr instead of manipulating __dict__
Since that's what they're for.
Diffstat (limited to 'alot/commands/globals.py')
-rw-r--r-- | alot/commands/globals.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 224b671b..59722887 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -402,8 +402,8 @@ class CallCommand(Command): if hooks: env = {'ui': ui, 'settings': settings} for k, v in env.items(): - if k not in hooks.__dict__: - hooks.__dict__[k] = v + if not getattr(hooks, k, None): + setattr(hooks, k, v) t = eval(self.command) if asyncio.iscoroutine(t): |