aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/signals/bug_79.py
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-11-26 11:54:37 +0100
committerChristian Tismer <tismer@stackless.com>2019-12-05 08:28:22 +0100
commit45a3efb4e179e83f1bea69cccb190945fbc8c1f8 (patch)
tree0cefe123ffdc876b933d2c76185098d2dd9c7eae /sources/pyside2/tests/signals/bug_79.py
parent6f79beb23aace35170d155517b9d901567a7f675 (diff)
Fix Python 3.8 problems
This patch fixes some refcounting problems with Python 3.8 . One incompatible change was announced in the what's new document, but actually there were two more problems which were not explicitly mentioned but took much time to sort out. The patch is compatible with the limited API changes (tested with debug build and API error disabled). It is also independent of the Python version which is full Limited API support. For more info, see the documentation mentioned below. The flag error is circumvented now! We either find a better solution or leave it as it is. For now this is ok. Fixes: PYSIDE-939 Change-Id: Iff4a9816857a6ebe86efd4b654d8921e4e464939 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2/tests/signals/bug_79.py')
-rw-r--r--sources/pyside2/tests/signals/bug_79.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/pyside2/tests/signals/bug_79.py b/sources/pyside2/tests/signals/bug_79.py
index 9eb783d77..4a595912c 100644
--- a/sources/pyside2/tests/signals/bug_79.py
+++ b/sources/pyside2/tests/signals/bug_79.py
@@ -56,13 +56,15 @@ class ConnectTest(unittest.TestCase):
# if this is no debug build, then we check at least that
# we do not crash any longer.
if not skiptest:
- total = sys.gettotalrefcount()
+ total = gettotalrefcount()
for idx in range(1000):
o.selectionModel().destroyed.connect(self.callback)
o.selectionModel().destroyed.disconnect(self.callback)
gc.collect()
if not skiptest:
- self.assertTrue(abs(gettotalrefcount() - total) < 10)
+ delta = gettotalrefcount() - total
+ print("delta total refcount =", delta)
+ self.assertTrue(abs(delta) < 10)
if __name__ == '__main__':