1
0

daemon error-handling: fix traceback.format_exception() on old python

The new API for traceback.format_exception was only added in python 3.10 (91e93794d5).
This commit is contained in:
SomberNight
2024-06-05 14:45:28 +00:00
parent 559184dc09
commit 7e29214219
3 changed files with 13 additions and 3 deletions

View File

@@ -6,6 +6,8 @@ from unittest import SkipTest
from PyQt6.QtCore import QCoreApplication, QMetaObject, Qt, pyqtSlot, QObject
from electrum.util import traceback_format_exception
class TestQCoreApplication(QCoreApplication):
@pyqtSlot()
@@ -76,7 +78,7 @@ def qt_test(func):
if not res:
self._e = Exception('testcase timed out')
if self._e:
print("".join(traceback.format_exception(self._e)))
print("".join(traceback_format_exception(self._e)))
# deallocate stored exception from qt thread otherwise we SEGV garbage collector
# instead, re-create using the exception message, special casing AssertionError and SkipTest
e = None