I have the following python code
a = 2
if a == 1:
b = 'blah'
print b
else:
print b
When I try to run it, I get a runtime error since 'b' is only defined in the 'if' clause, not the 'else'.
Pylint and Pyflakes both failed to detect this issue.
Is there any other way I can detect it without running the code?