mirror of
https://github.com/google/blockly.git
synced 2026-01-04 23:50:12 +01:00
Resolve warnings in generator code (#3350)
This commit is contained in:
@@ -199,7 +199,7 @@ Blockly.Python['lists_setIndex'] = function(block) {
|
||||
return '';
|
||||
}
|
||||
var listVar = Blockly.Python.variableDB_.getDistinctName(
|
||||
'tmp_list', Blockly.Variables.NAME_TYPE);
|
||||
'tmp_list', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
var code = listVar + ' = ' + list + '\n';
|
||||
list = listVar;
|
||||
return code;
|
||||
@@ -240,7 +240,7 @@ Blockly.Python['lists_setIndex'] = function(block) {
|
||||
Blockly.Python.definitions_['import_random'] = 'import random';
|
||||
var code = cacheList();
|
||||
var xVar = Blockly.Python.variableDB_.getDistinctName(
|
||||
'tmp_x', Blockly.Variables.NAME_TYPE);
|
||||
'tmp_x', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
code += xVar + ' = int(random.random() * len(' + list + '))\n';
|
||||
if (mode == 'SET') {
|
||||
code += list + '[' + xVar + '] = ' + value + '\n';
|
||||
|
||||
Reference in New Issue
Block a user