- if os.path.isfile(self.out_path):
- try:
- capture = self.get_capture(
- 0, timeout=timeout, remark=remark,
- filter_out_fn=filter_out_fn)
- if not capture or len(capture.res) == 0:
- # junk filtered out, we're good
- return
- except:
- pass
- self.generate_debug_aid("empty-assert")
- if remark:
- raise UnexpectedPacketError(
- capture[0],
- f" ({len(capture)} packets captured in total) ({remark})")
- else:
- raise UnexpectedPacketError(
- capture[0], f" ({len(capture)} packets captured in total)")
+ capture = self.get_capture(0, timeout=timeout, remark=remark,
+ filter_out_fn=filter_out_fn)
+ if not capture or len(capture.res) == 0:
+ # junk filtered out, we're good
+ return