• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(1520)  |  Call(1450)  |  Derive(0)  |  Import(70)
Format a stack trace and the exception information.

The arguments have the same meaning as the corresponding arguments
to print_exception().  The return value is a list of strings, each
ending in a newline and some containing internal newlines.  When
these lines are concatenated and printed, exactly the same text is
printed as does print_exception().

        def format_exception(etype, value, tb, limit = None):
    """Format a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    """
    if tb:
        list = ['Traceback (most recent call last):\n']
        list = list + format_tb(tb, limit)
    else:
        list = []
    list = list + format_exception_only(etype, value)
    return list
        


src/b/r/braintree_python_examples-HEAD/tr_checkout_app_engine/web/wsgiserver/__init__.py   braintree_python_examples(Download)
def format_exc(limit=None):
    """Like print_exc() but return a string. Backport for Python 2.3."""
    try:
        etype, value, tb = sys.exc_info()
        return ''.join(traceback.format_exception(etype, value, tb, limit))
    finally:
        etype = value = tb = None

src/c/l/clearsilver-0.10.1/clearsilver/python/examples/base/handle_error.py   clearsilver(Download)
def exceptionString():
  tb_list = traceback.format_exception(sys.exc_type,sys.exc_value,sys.exc_traceback)
  return string.join(tb_list,"")
 
  #### old way
  import StringIO
  ## get the traceback message  
def handleException (msg=None, lvl=LV_ERROR, dump = 1):
  global gErrorCount
  gErrorCount = gErrorCount + 1
 
  tb_list = traceback.format_exception(sys.exc_type,sys.exc_value,sys.exc_traceback)
  if msg:
    sys.stderr.write ("%s\n" % msg)

src/s/p/spike-HEAD/vendor/stackless/v2.5.1/Demo/tix/samples/DirList.py   spike(Download)
    except:
        t, v, tb = sys.exc_info()
        text = "Error running the demo script:\n"
        for line in traceback.format_exception(t,v,tb):
            text = text + line + '\n'
            d = tkMessageBox.showerror ( 'Tix Demo Error', text)
 

src/s/p/spike-HEAD/vendor/stackless/current/Demo/tix/samples/DirList.py   spike(Download)
    except:
        t, v, tb = sys.exc_info()
        text = "Error running the demo script:\n"
        for line in traceback.format_exception(t,v,tb):
            text = text + line + '\n'
            d = tkMessageBox.showerror ( 'Tix Demo Error', text)
 

src/s/p/spike-HEAD/vendor/Python/v2.5.1/Demo/tix/samples/DirList.py   spike(Download)
    except:
        t, v, tb = sys.exc_info()
        text = "Error running the demo script:\n"
        for line in traceback.format_exception(t,v,tb):
            text = text + line + '\n'
            d = tkMessageBox.showerror ( 'Tix Demo Error', text)
 

src/s/p/spike-HEAD/vendor/Python/current/Demo/tix/samples/DirList.py   spike(Download)
    except:
        t, v, tb = sys.exc_info()
        text = "Error running the demo script:\n"
        for line in traceback.format_exception(t,v,tb):
            text = text + line + '\n'
            d = tkMessageBox.showerror ( 'Tix Demo Error', text)
 

src/s/t/stackless-HEAD/Demo/tix/samples/DirList.py   stackless(Download)
    except:
        t, v, tb = sys.exc_info()
        text = "Error running the demo script:\n"
        for line in traceback.format_exception(t,v,tb):
            text = text + line + '\n'
            d = tkMessageBox.showerror ( 'Tix Demo Error', text)
 

src/p/y/python2.6-cmake-HEAD/Demo/tix/samples/DirList.py   python2.6-cmake(Download)
    except:
        t, v, tb = sys.exc_info()
        text = "Error running the demo script:\n"
        for line in traceback.format_exception(t,v,tb):
            text = text + line + '\n'
            d = tkMessageBox.showerror ( 'Tix Demo Error', text)
 

src/b/a/badger-lib-HEAD/packages/nose/examples/html_plugin/htmlplug.py   badger-lib(Download)
    def formatErr(self, err):
        exctype, value, tb = err
        return ''.join(traceback.format_exception(exctype, value, tb))
 
    def setOutputStream(self, stream):
        # grab for own use
        self.stream = stream        

src/u/n/unladen-swallow-HEAD/Demo/tix/samples/DirList.py   unladen-swallow(Download)
    except:
        t, v, tb = sys.exc_info()
        text = "Error running the demo script:\n"
        for line in traceback.format_exception(t,v,tb):
            text = text + line + '\n'
            d = tkMessageBox.showerror ( 'Tix Demo Error', text)
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next