Skip to content
Snippets Groups Projects
Commit 32dd945c authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

bugfix, 2.0.5

parent de2c85b7
No related branches found
No related tags found
No related merge requests found
......@@ -198,16 +198,21 @@ class Traceback(object):
value_pickling_policy = policy()
tb = sys.exc_info()[2]
while tb.tb_next:
tb = tb.tb_next
self.frames = []
f = tb.tb_frame
while f:
self.frames.append(StackFrame(f, value_pickling_policy))
f = f.f_back
self.formatted_traceback = six.text_type(traceback.format_exc())
if tb is None:
self.formatted_traceback = u'No exception.'
else:
while tb.tb_next:
tb = tb.tb_next
f = tb.tb_frame
while f:
self.frames.append(StackFrame(f, value_pickling_policy))
f = f.f_back
self.formatted_traceback = six.text_type(traceback.format_exc())
def pickle(self):
"""Returns this instance, pickled"""
......
......@@ -2,7 +2,7 @@
from setuptools import setup, find_packages
setup(name='satella',
version='2.0.4a1',
version='2.0.5',
description=u'Utilities for writing servers in Python',
author=u'Piotr Maślanka',
author_email='piotrm@smok.co',
......
......@@ -8,6 +8,11 @@ from satella.instrumentation import Traceback
class TestTraceback(unittest.TestCase):
def test_no_exc(self):
tb = Traceback()
def test_tb(self):
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment