MCPcopy Index your code
hub / github.com/secdev/scapy / destroy

Method destroy

scapy/automaton.py:1567–1584  ·  view source on GitHub ↗

Destroys a stopped Automaton: this cleanups all opened file descriptors. Required on PyPy for instance where the garbage collector behaves differently.

(self)

Source from the content-addressed store, hash-verified

1565 cmd.clear()
1566
1567 def destroy(self):
1568 # type: () -> None
1569 """
1570 Destroys a stopped Automaton: this cleanups all opened file descriptors.
1571 Required on PyPy for instance where the garbage collector behaves differently.
1572 """
1573 if not hasattr(self, "started"):
1574 return # was never started.
1575 if self.isrunning():
1576 raise ValueError("Can't close running Automaton ! Call stop() beforehand")
1577 # Close command pipes
1578 self.cmdin.close()
1579 self.cmdout.close()
1580 self._flush_inout()
1581 # Close opened ioins/ioouts
1582 for i in itertools.chain(self.ioin.values(), self.ioout.values()):
1583 if isinstance(i, ObjectPipe):
1584 i.close()
1585
1586 def stop(self, wait=True):
1587 # type: (bool) -> None

Callers 3

__del__Method · 0.95
closeMethod · 0.45
_runMethod · 0.45

Calls 4

isrunningMethod · 0.95
_flush_inoutMethod · 0.95
closeMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected