File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -117,20 +117,18 @@ def is_ascii(data):
117
117
118
118
try :
119
119
print ("packet length:" , len (data ))
120
- print ("method call[1]:" , sys ._getframe (1 ).f_code .co_name )
121
- print ("method call[2]:" , sys ._getframe (2 ).f_code .co_name )
122
- print ("method call[3]:" , sys ._getframe (3 ).f_code .co_name )
123
- print ("method call[4]:" , sys ._getframe (4 ).f_code .co_name )
124
- print ("method call[5]:" , sys ._getframe (5 ).f_code .co_name )
125
- print ("-" * 88 )
120
+ for i in range (1 , 6 ):
121
+ f = sys ._getframe (i )
122
+ print ("call[%d]: %s (line %d)" % (i , f .f_code .co_name , f .f_lineno ))
123
+ print ("-" * 66 )
126
124
except ValueError :
127
125
pass
128
126
dump_data = [data [i :i + 16 ] for i in range_type (0 , min (len (data ), 256 ), 16 )]
129
127
for d in dump_data :
130
128
print (' ' .join (map (lambda x : "{:02X}" .format (byte2int (x )), d )) +
131
129
' ' * (16 - len (d )) + ' ' * 2 +
132
- ' ' .join (map (lambda x : "{}" .format (is_ascii (x )), d )))
133
- print ("-" * 88 )
130
+ '' .join (map (lambda x : "{}" .format (is_ascii (x )), d )))
131
+ print ("-" * 66 )
134
132
print ()
135
133
136
134
You can’t perform that action at this time.
0 commit comments