PyDev.Debugger
PyDev.Debugger copied to clipboard
TypeError: Error when calling the metaclass bases
The pydevd_thread_wrappers.py
module decorates the Queue
class. Somewhere in my code I define the dataBuffer
class that derives from the Queue
class but when I try to run my script in PyCharm "concurrency diagram" mode Python fails with a weird error:
Importing test library 'RXLibrary' failed: TypeError: Error when calling the metaclass bases
function() argument 1 must be code, not str
Traceback (most recent call last):
File "C:\Users\salemi\Documents\vcs\spark\libraries\RXLibrary.py", line 32, in <module>
import septentrio.pytest_rxGeneric as rxGeneric
File "C:\Users\salemi\Documents\vcs\spark\libraries\septentrio\pytest_rxGeneric.py", line 8, in <module>
import pytest_dataInOut as dataInOut
File "C:\Users\salemi\Documents\vcs\spark\libraries\septentrio\pytest_dataInOut.py", line 67, in <module>
class dataBuffer(Queue.Queue):
PYTHONPATH:
C:\Users\salemi\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\191.7479.30\helpers\pydev
...
As far as I know a decorated class becomes a function and I could understand that Python cannot derive from a function.
How can I solve this problem?
It seems that the PyCharm version has things not available in the version on pydevd
(there's no pydevd_thread_wrappers.py
module in pydevd
), so, you should report to PyCharm.
The module is there:
https://github.com/fabioz/PyDev.Debugger/blob/master/pydevd_concurrency_analyser/pydevd_thread_wrappers.py
Oops, sorry about that... I think I searched for something wrong -- reopening ;)
No problem :)
Would it help to create a small reproducible example?
If you're up to it, what would really help is a test-case (see: tests_python/test_debugger.py
) -- as a note, the concurrency analyzer is currently lacking tests, but it should be straightforward to create a test for it based on other tests.
I will take a shot at creating a failing test case.