MCPcopy Create free account
hub / github.com/ipython/ipython / remove

Method remove

IPython/lib/backgroundjobs.py:295–310  ·  view source on GitHub ↗

Remove a finished (completed or dead) job.

(self,num)

Source from the content-addressed store, hash-verified

293 self._dead_report[:] = []
294
295 def remove(self,num):
296 """Remove a finished (completed or dead) job."""
297
298 try:
299 job = self.all[num]
300 except KeyError:
301 error('Job #%s not found' % num)
302 else:
303 stat_code = job.stat_code
304 if stat_code == self._s_running:
305 error('Job #%s is still running, it can not be removed.' % num)
306 return
307 elif stat_code == self._s_completed:
308 self.completed.remove(job)
309 elif stat_code == self._s_dead:
310 self.dead.remove(job)
311
312 def flush(self):
313 """Flush all finished jobs (completed and dead) from lists.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected