Fix tests.unit.reports.test_guru_meditation_report under Python3

Change-Id: Ib329965aecc5e685eed9c1d313ffe1b709981b71
This commit is contained in:
Frederic Lepied 2014-04-14 18:45:23 -04:00
parent 12ceab4c21
commit 91af2ba9a8
2 changed files with 5 additions and 4 deletions

View File

@ -42,12 +42,12 @@ class StackTraceModel(mwdv.ModelWithDefaultViews):
{'filename': fn, 'line': ln, 'name': nm, 'code': cd}
for fn, ln, nm, cd in traceback.extract_stack(stack_state)
]
if stack_state.f_exc_type is not None:
# FIXME(flepied): under Python3 f_exc_type doesn't exist
# anymore so we lose information about exceptions
if getattr(stack_state, 'f_exc_type', None) is not None:
self['root_exception'] = {
'type': stack_state.f_exc_type,
'value': stack_state.f_exc_value
}
'value': stack_state.f_exc_value}
else:
self['root_exception'] = None
else:

View File

@ -99,6 +99,7 @@ commands =
tests/unit/test_uuidutils.py \
tests/unit/test_xmlutils.py \
tests/unit/test_versionutils.py \
tests/unit/reports/test_guru_meditation_report.py \
tests/unit/reports/test_views.py
[testenv:pyflakes]