p4lang / ptf

Packet Test Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ptf]: EventDescriptor destructor fails with exception

nazariig opened this issue · comments

Summary
EventDescriptor class has a bug in destructor implementation.
It tries to access nonexistent system library and fails with the exception:

Exception AttributeError: "'NoneType' object has no attribute 'close'" in <bound method EventDescriptor.__del__ of <ptf.ptfutils.EventDescriptor instance at 0x7f18966645a8>> ignored

line: https://github.com/p4lang/ptf/blob/master/src/ptf/ptfutils.py#L52

Steps to reproduce

  • Run PTF

Observed behavior
EventDescriptor destructor throws an exception

Expected behavior
EventDescriptor destructor should do a clean up gracefully

How to solve this problem? thank you!