Stepping through a multithreaded program

  • Thread starter Fernando Rodríguez
  • Start date
F

Fernando Rodríguez

Hi,

I was trying to step through a first attemp of multithreaded script (see
below), with PythonWin, but I'm gettign a very strange error:

---------------------------------------------------------------------------------
import threading

times = 100
delay = 10000

class egoistThread(threading.Thread):
def __init__(self, id, times, delay):
threading.Thread.__init__(self)
self.id = id
self.times = times
self.delay = delay
def run(self):
for i in xrange(self.times):
print self.id,
for j in xrange(self.delay):
pass

egoists = []
for elt in 'abc':
egoists.append(egoistThread(elt, times, delay))

"""
When I reach this point, I get a weird error see below
"""
for ego in egoists:
ego.start()


for ego in egoists:
ego.join()
------------------------------------------------------------------------------

The error is:
Traceback (most recent call last):
File
"C:\ARCHIV~1\python23\lib\site-packages\Pythonwin\pywin\framework\dbgcommands.py",
line 65, in OnStepOver
self._DoOrStart("do_set_next", scriptutils.RS_DEBUGGER_STEP)
File
"C:\ARCHIV~1\python23\lib\site-packages\Pythonwin\pywin\framework\dbgcommands.py",
line 57, in _DoOrStart
method()
File
"C:\ARCHIV~1\python23\lib\site-packages\Pythonwin\pywin\debugger\debugger.py",
line 629, in do_set_next
if self.GUIAboutToRun():
File
"C:\ARCHIV~1\python23\lib\site-packages\Pythonwin\pywin\debugger\debugger.py",
line 788, in GUIAboutToRun
if not self.StopDebuggerPump():
File
"C:\ARCHIV~1\python23\lib\site-packages\Pythonwin\pywin\debugger\debugger.py",
line 484, in StopDebuggerPump
assert self.pumping, "Can't stop the debugger pump if Im not pumping!"
AssertionError: Can't stop the debugger pump if Im not pumping!

Any ideas? O:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top