Change built-in variable name list to ls
Don't use built-in functions in python as variables.
It may lead to unexpected errors as:
Following error reproduced while clicking on 'pi' and 'e' of Toolbar
1593526849.741283 ERROR root: Internal error (<class 'UnboundLocalError'>): local variable
'list' referenced before assignment
Traceback (most recent call last):
File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 674, in evaluat
e
ret = self._process_node(eqn, state)
File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 444, in _proces
s_node
return self._process_node(node.value, state)
File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 515, in _proces
s_node
if node.id not in list(state.used_var_ofs.keys()):
UnboundLocalError: local variable 'list' referenced before assignment
Reported by - Shaan Subbaiah<shaansubbaiah.cs18@bmsce.ac.in>
Tested by - Saumya Mishra <2017230@iiitdmj.ac.in>
Saumya-Mishra9129 authored 3 years ago
Ibiam Chihurumnaya committed 3 years ago
496 | 496 | return node.s |
497 | 497 | |
498 | 498 | elif isinstance(node, ast.Tuple): |
499 | list = [self._process_node(i, state) for i in node.elts] | |
500 | return tuple(list) | |
499 | ls = [self._process_node(i, state) for i in node.elts] | |
500 | return tuple(ls) | |
501 | 501 | |
502 | 502 | elif isinstance(node, ast.Name): |
503 | 503 | if not isfunc and node.id in ('help', _('help')): |