Resolve warnings in generator code (#3350)

This commit is contained in:
Sam El-Husseini
2019-10-28 09:35:40 -07:00
committed by GitHub
parent fa5f256a3f
commit 64c52efb5b
34 changed files with 81 additions and 80 deletions

View File

@@ -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';