[tor-commits] [bridgedb/master] Catch Attribute error if object wasn't save in persistent.State.

isis at torproject.org isis at torproject.org
Sun Jan 12 06:06:32 UTC 2014


commit b4aa71727b1b939d1a4a6f294689de2a3e64978b
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sat Nov 16 00:35:41 2013 +0000

    Catch Attribute error if object wasn't save in persistent.State.
    
    This happens on first run, if a `Conf` isn't saved as state.config.
---
 lib/bridgedb/persistent.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bridgedb/persistent.py b/lib/bridgedb/persistent.py
index 6c9ebea..4429ea4 100644
--- a/lib/bridgedb/persistent.py
+++ b/lib/bridgedb/persistent.py
@@ -254,7 +254,7 @@ class State(jelly.Jellyable):
                     updated.append(key)
                     logging.debug("Updated %s setting: %r → %r"
                                   % (key, self.config.__dict__[key], value))
-            except KeyError:
+            except (KeyError, AttributeError):
                 setattr(self, key, value)
                 new.append(key)
                 logging.debug("New setting: %s = %r" % (key, value))





More information about the tor-commits mailing list