Commit 6f76b25a authored by Federico Vaga's avatar Federico Vaga

sw:py: close DMA file when object is removed for good

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent a32476d7
......@@ -16,6 +16,9 @@ class PySPEC:
self.debugfs_fpga = os.path.join(self.debugfs, "spec-0000:{:s}".format(self.pci_id))
self.dma = os.path.join(self.debugfs_fpga, "dma")
def __del__(self):
self.dma_stop()
def dma_start(self):
self.dma_file = open(self.dma, "rb", buffering=0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment