Skip to content

Commit bd598b8

Browse files
committed
Remove accidentally added debug code
1 parent e90d8b5 commit bd598b8

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

tests/test_qeventloop.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,7 @@
1818
import pytest
1919

2020
import qasync
21-
2221
from qasync import QtCore
23-
import traceback, logging
24-
25-
_orig_setParent = QtCore.QObject.setParent
26-
27-
28-
def _dbg_setParent(self, parent):
29-
if parent is not None:
30-
try:
31-
same = parent.thread() is self.thread()
32-
except Exception:
33-
same = False
34-
if not same:
35-
logging.error(
36-
"QObject.setParent across threads: obj=%r obj.thread=%r parent=%r parent.thread=%r",
37-
self,
38-
self.thread(),
39-
parent,
40-
getattr(parent, "thread", lambda: None)(),
41-
)
42-
traceback.print_stack() # prints Python stack where setParent was called
43-
# Optionally raise so test fails and you can inspect the stack in the debugger:
44-
# raise RuntimeError("setParent called from wrong thread")
45-
return _orig_setParent(self, parent)
46-
47-
48-
QtCore.QObject.setParent = _dbg_setParent
4922

5023

5124
@pytest.fixture

0 commit comments

Comments
 (0)