'bool' object is not subscriptable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Running pyflakes on this file https:/
Traceback (most recent call last):
File "bin/pyflakes", line 3, in <module>
main()
File "/Users/
warnings = checkRecursive(
File "/Users/
warnings += checkPath(
File "/Users/
return check(codestr, filename, reporter)
File "/Users/
w = checker.
File "/Users/
self.
File "/Users/
handler()
File "/Users/
self.
File "/Users/
handler(node)
File "/Users/
self.
File "/Users/
handler(node)
File "/Users/
self.
File "/Users/
if used and used[0] is self.scope and name not in self.scope.globals:
TypeError: 'bool' object is not subscriptable
Changed in pyflakes: | |
status: | Fix Committed → Fix Released |
The change from 531b6b58 (shown below) seems to be related, but even after reverting it it gives the same error.
@@ -473,8 +477,8 @@ class Checker(object): globals) :
# then it's probably a mistake
self.report( messages. UndefinedLocal,
scope[ name].used[ 1], name, scope[name].source)
# if the name was defined in that scope, and the name has
# been accessed already in the current scope, and hasn't
# been declared global
- if (name in scope and scope[name].used and scope[name].used[0] is self.scope
- and name not in self.scope.
+ used = name in scope and scope[name].used
+ if used and used[0] is self.scope and name not in self.scope.globals: