Add Traceback to failing packet_match

This helps finding the caller/cause of the failure

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
pull/2580/head
Kai Buschulte 3 years ago committed by Roger A. Light
parent 8b5a86fd52
commit 4eadc96bcb

@ -1,3 +1,4 @@
import atexit
import errno
import os
import socket
@ -6,6 +7,8 @@ import struct
import sys
import time
import traceback
import mqtt5_props
import __main__
@ -141,6 +144,7 @@ def packet_matches(name, recvd, expected):
print("Expected: "+to_string(expected))
except struct.error:
print("Expected (not decoded, len=%d): %s" % (len(expected), expected))
traceback.print_stack(file=sys.stdout)
return False
else:

Loading…
Cancel
Save