[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/__init__.py Restored logic to optionally monkeypatch the traceback module with

Jim Fulton jim at zope.com
Sun Jun 4 10:58:57 EDT 2006


Log message for revision 68482:
  Restored logic to optionally monkeypatch the traceback module with
  Zope-style exceptions.
  

Changed:
  U   zope.testing/trunk/src/zope/testing/__init__.py

-=-
Modified: zope.testing/trunk/src/zope/testing/__init__.py
===================================================================
--- zope.testing/trunk/src/zope/testing/__init__.py	2006-06-03 19:31:11 UTC (rev 68481)
+++ zope.testing/trunk/src/zope/testing/__init__.py	2006-06-04 14:58:55 UTC (rev 68482)
@@ -15,3 +15,16 @@
 
 $Id$
 """
+import os
+
+def patchTracebackModule():
+    """Use the ExceptionFormatter to show more info in tracebacks.
+    """
+    from zope.exceptions.exceptionformatter import format_exception
+    import traceback
+    traceback.format_exception = format_exception
+
+# Don't use the new exception formatter by default, since it
+# doesn't show filenames.
+if os.environ.get('NEW_ZOPE_EXCEPTION_FORMATTER', 0):
+    patchTracebackModule()



More information about the Zope3-Checkins mailing list