コード例 #1
0
 def _callFUT(self, as_html=False):
     from zope.exceptions.exceptionformatter import extract_stack
     f = sys.exc_info()[2].tb_frame
     try:
         return ''.join(extract_stack(f, as_html=as_html))
     finally:
         del f
コード例 #2
0
 def test_noinput(self):
     try:
         raise ExceptionForTesting
     except ExceptionForTesting:
         from zope.exceptions.exceptionformatter import extract_stack
         s = ''.join(extract_stack())
         self.assertTrue(s.find('test_noinput') >= 0)
コード例 #3
0
 def test_noinput(self):
     try:
         raise ExceptionForTesting
     except ExceptionForTesting:
         from zope.exceptions.exceptionformatter import extract_stack
         s = ''.join(extract_stack())
         self.assertTrue(s.find('test_noinput') >= 0)
コード例 #4
0
 def _callFUT(self, as_html=False):
     from zope.exceptions.exceptionformatter import extract_stack
     f = sys.exc_info()[2].tb_frame
     try:
         return ''.join(extract_stack(f, as_html=as_html))
     finally:
         del f
コード例 #5
0
 def _collect_traceback(self):
     try:
         raise ValueError('boom')
     except:
         # we need here exceptionformatter, otherwise __traceback_info__
         # is not added
         stack = exceptionformatter.extract_stack(
             sys.exc_info()[2].tb_frame.f_back, limit=TB_LIMIT)
         tb = ''.join(stack[:-2])
         return tb
コード例 #6
0
ファイル: querystats.py プロジェクト: Shoobx/pjpersist
 def _collect_traceback(self):
     try:
         raise ValueError('boom')
     except:
         # we need here exceptionformatter, otherwise __traceback_info__
         # is not added
         stack = exceptionformatter.extract_stack(
             sys.exc_info()[2].tb_frame.f_back, limit=TB_LIMIT)
         tb = ''.join(stack[:-2])
         return tb
コード例 #7
0
ファイル: datamanager.py プロジェクト: kedder/mongopersist
    def __call__(self, *args, **kwargs):
        if self.ADD_TB:
            try:
                raise ValueError('boom')
            except:
                # we need here exceptionformatter, otherwise __traceback_info__
                # is not added
                tb = ''.join(exceptionformatter.extract_stack(
                    sys.exc_info()[2].tb_frame.f_back, limit=self.TB_LIMIT))
        else:
            tb = '  <omitted>'

        txn = transaction.get()
        txn = '%i - %s' % (id(txn), txn.description),

        COLLECTION_LOG.debug(
            "collection: %s.%s %s,\n TXN:%s,\n args:%r,\n kwargs:%r, \n tb:\n%s",
            self.collection.database.name, self.collection.name,
            self.function.__name__, txn, args, kwargs, tb)

        return self.function(*args, **kwargs)
コード例 #8
0
ファイル: datamanager.py プロジェクト: ndurell/mongopersist
    def __call__(self, *args, **kwargs):
        if self.ADD_TB:
            try:
                raise ValueError('boom')
            except:
                # we need here exceptionformatter, otherwise __traceback_info__
                # is not added
                tb = ''.join(
                    exceptionformatter.extract_stack(
                        sys.exc_info()[2].tb_frame.f_back,
                        limit=self.TB_LIMIT))
        else:
            tb = '  <omitted>'

        txn = transaction.get()
        txn = '%i - %s' % (id(txn), txn.description),

        COLLECTION_LOG.debug(
            "collection: %s.%s %s,\n TXN:%s,\n args:%r,\n kwargs:%r, \n tb:\n%s",
            self.collection.database.name, self.collection.name,
            self.function.__name__, txn, args, kwargs, tb)

        return self.function(*args, **kwargs)
コード例 #9
0
def st(as_html=0):
    f = sys.exc_info()[2].tb_frame
    try:
        return ''.join(extract_stack(f, as_html=as_html))
    finally:
        del f