                 stream: 'pyout'
             result.data['text/plain'] = result.data['text/plain'].trim()
 
-        else if mime?
+        else
             result =
                 data:   {}
                 type:   mime

        return result


    _parseErrorIOMessage: (message) ->
        msg_type = message.header.msg_type

        if msg_type is 'error' or msg_type == 'pyerr'
            result = @_parseErrorMessage message

        return result



    onShellMessage: (message) ->
        console.log 'shell message:', message

        unless @_isValidMessage message
            return
