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

[tor-commits] [arm/master] Catch conn.init() exception in case starter wants detached startup.



commit 7a863f9fdda39f0f9a0d2cd572a283ba38fa37bf
Author: Kamran Riaz Khan <krkhan@xxxxxxxxxxxxxx>
Date:   Sat Jul 16 00:49:42 2011 +0500

    Catch conn.init() exception in case starter wants detached startup.
---
 src/gui/graphing/bandwidthStats.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/gui/graphing/bandwidthStats.py b/src/gui/graphing/bandwidthStats.py
index 401302c..04dfda8 100644
--- a/src/gui/graphing/bandwidthStats.py
+++ b/src/gui/graphing/bandwidthStats.py
@@ -8,6 +8,7 @@ import gobject
 import gtk
 
 from TorCtl import TorCtl
+from starter import CONFIG
 from gui.graphing import graphStats
 from util import uiTools, torTools
 
@@ -17,7 +18,13 @@ class BandwidthStats(graphStats.GraphStats):
 
     conn = torTools.getConn()
     if not conn.isAlive():
-      conn.init()
+      try:
+        conn.init()
+      except ValueError:
+        if CONFIG['features.allowDetachedStartup']:
+          return
+        else:
+          raise
 
     conn.setControllerEvents(["BW", "NEWDESC"])
     conn.addEventListener(self)



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