[tor-commits] [chutney/master] Ticket 33304 - Return None for pid when pid file is empty

teor at torproject.org teor at torproject.org
Thu Feb 13 06:58:01 UTC 2020


commit 185852f602ccd9168d7b7d5d13ad060feaa7a57d
Author: Steven Engler <sengler at uwaterloo.ca>
Date:   Wed Feb 12 23:59:47 2020 -0500

    Ticket 33304 - Return None for pid when pid file is empty
---
 lib/chutney/TorNet.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 47b8e84..6f4041a 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -863,7 +863,10 @@ class LocalNodeController(NodeController):
             return None
 
         with open(pidfile, 'r') as f:
-            return int(f.read())
+            try:
+                return int(f.read())
+            except ValueError:
+                return None
 
     def isRunning(self, pid=None):
         """Return true iff this node is running.  (If 'pid' is provided, we





More information about the tor-commits mailing list