Make sure that single commands still work

This commit is contained in:
Ben Jackson 2019-03-01 13:26:05 +00:00
commit cc7af4b1a4

View file

@ -541,23 +541,23 @@ class DebugSession( object ):
elif commands is not None: elif commands is not None:
raise ValueError( "Invalid commands; must be list" ) raise ValueError( "Invalid commands; must be list" )
commands = remote[ pfx + 'Command' ] command = remote[ pfx + 'Command' ]
if isinstance( commands, str ): if isinstance( command, str ):
commands = shlex.split( commands ) command = shlex.split( command )
if not isinstance( commands, list ): if not isinstance( command, list ):
raise ValueError( "Invalid command; must be list/string" ) raise ValueError( "Invalid command; must be list/string" )
if not commands: if not command:
raise ValueError( 'Could not determine commands for ' + pfx ) raise ValueError( 'Could not determine commands for ' + pfx )
return commands return [ command ]
def _Initialise( self ): def _Initialise( self ):
def handle_initialize_response( msg ): def handle_initialize_response( msg ):
self._server_capabilities = msg.get( 'body' ) or {} self._server_capabilities = msg.get( 'body' ) or {}
self._Launch() self._Launch()
self._connection.DoRequest( handle_initialize_response, { self._connection.DoRequest( handle_initialize_response, {
'command': 'initialize', 'command': 'initialize',