mailr22768 - /trunk/lib/warnings.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on April 15, 2014 - 16:27:
Author: bugman
Date: Tue Apr 15 16:27:20 2014
New Revision: 22768

URL: http://svn.gna.org/viewcvs/relax?rev=22768&view=rev
Log:
Created the lib.warnings.TRACEBACK variable.

When True, this will cause stack-traceback to be printed out with the 
warning.  This is to decouple
the traceback printout from the warning to error escalation.


Modified:
    trunk/lib/warnings.py

Modified: trunk/lib/warnings.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/warnings.py?rev=22768&r1=22767&r2=22768&view=diff
==============================================================================
--- trunk/lib/warnings.py       (original)
+++ trunk/lib/warnings.py       Tue Apr 15 16:27:20 2014
@@ -34,6 +34,7 @@
 
 # Module variables for changing the behaviour of the warning system.
 ESCALATE = False    # If True, warnings will be converted into errors.
+TRACEBACK = False    # If True, a traceback will be printed out with the 
warnings.
 
 
 # The warning formatting function.
@@ -44,7 +45,7 @@
     message = "RelaxWarning: %s\n" % message
 
     # Print stack-trace in escalate mode.
-    if ESCALATE:
+    if TRACEBACK:
         tb = ""
         for frame in inspect.stack()[4:]:
             file = frame[1]




Related Messages


Powered by MHonArc, Updated Tue Apr 15 16:40:02 2014