changeset 437:fa3b65b68971

server side: ipdb is used instead of pdb in debug mode
author Goffi <goffi@goffi.org>
date Tue, 06 May 2014 23:08:08 +0200
parents 73f767a9ac2f
children 582c435dab6b
files twisted/plugins/libervia.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/twisted/plugins/libervia.py	Thu May 01 11:31:51 2014 +0200
+++ b/twisted/plugins/libervia.py	Tue May 06 23:08:08 2014 +0200
@@ -17,6 +17,17 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+from twisted.internet import defer
+if defer.Deferred.debug:
+    # if we are in debug mode, we want to use ipdb instead of pdb
+    try:
+        import ipdb
+        import pdb
+        pdb.set_trace = ipdb.set_trace
+        pdb.post_mortem = ipdb.post_mortem
+    except ImportError:
+        pass
+
 from zope.interface import implements
 
 from twisted.python import usage