From 27316ce5f1cd0d6892b953a4e828d7d062350e31 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Mon, 7 Sep 2009 17:10:46 -0800 Subject: [PATCH] don't fail if we can't debug.. mean you can run multiple instances on a single computer.. [git-p4: depot-paths = "//depot/": change = 1379] --- debug.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debug.py b/debug.py index 6b90624..3a27b03 100644 --- a/debug.py +++ b/debug.py @@ -5,6 +5,7 @@ __version__ = '$Change$' # $Id$ from twisted.internet import reactor +import twisted.internet.error # Make sure to update the global line when adding a new function __all__ = [ 'appendnamespace', 'insertnamespace', 'insertringbuf' ] @@ -67,4 +68,7 @@ def doDebugging(opt): sf = telnet.ShellFactory() sf.protocol = Debug - reactor.listenTCP(56283, sf) + try: + reactor.listenTCP(56283, sf) + except twisted.internet.error.CannotListenError: + print 'WARNING: cannot bind to debugger port.'