More workarounds for free-and-loose-with-the-spec servers

This commit is contained in:
Ben Jackson 2018-06-01 19:55:51 +01:00
commit fcf19a6d52
2 changed files with 5 additions and 1 deletions

View file

@ -62,6 +62,10 @@ class StackTraceView( object ):
def consume_threads( message ):
self._threads.clear()
if not message[ 'body' ][ 'threads' ]:
# This is a protocol error. It is required to return at least one!
raise ValueError( 'Server returned no threads. Is it running?' )
for thread in message[ 'body' ][ 'threads' ]:
self._threads.append( thread )

View file

@ -179,7 +179,7 @@ class VariablesView( object ):
'_variables' not in variable ) else '-',
name = variable[ 'name' ],
type_ = variable.get( 'type', '<unknown type>' ),
value = variable[ 'value' ] ).split( '\n' ) )
value = variable.get( 'value', '<unknown value>' ) ).split( '\n' ) )
if '_variables' in variable:
self._DrawVariables( variable[ '_variables' ], indent + 2 )