[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit b4aa71727b1b939d1a4a6f294689de2a3e64978b
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
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))



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits