2015-03-12 01:21:42 |
John L. Villalovos |
description |
$ cat tt.py
#!/usr/bin/python -tt
import random
import sys
def main():
f = None
try:
f = "bob"
if random.choice((True, False)):
raise Exception('test')
except:
del f
raise Exception('my custom exception')
print f
if '__main__' == __name__:
sys.exit(main())
$ flake8 tt.py
tt.py:15:1: F821 undefined name 'f' |
$ cat tt.py
#!/usr/bin/python -tt
import random
import sys
def main():
f = None
try:
f = "bob"
if random.choice((True, False)):
raise Exception('test')
except:
del f
raise Exception('my custom exception')
print f
if '__main__' == __name__:
sys.exit(main())
$ $ pyflakes tt.py
tt.py:15: undefined name 'f' |
|