Skip to content

Commit fa51676

Browse files
author
cclauss
authored
Undefined name: exception --> Exception
exception (lowercase 'e') is an undefined name in this context while Exception (uppercase 'e') is the superclass. flake8 testing of https://github.com/cclauss/pythonparser on Python 2.7.14 $ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics ./pythonparser/source.py:259:9: F821 undefined name 'exception' exception.__init__(self, "Ranges %s and %s overlap" % (repr(first), repr(second))) ^ 1 F821 undefined name 'exception' 1
1 parent c3359ad commit fa51676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pythonparser/source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class RewriterConflict(Exception):
256256

257257
def __init__(self, first, second):
258258
self.first, self.second = first, second
259-
exception.__init__(self, "Ranges %s and %s overlap" % (repr(first), repr(second)))
259+
Exception.__init__(self, "Ranges %s and %s overlap" % (repr(first), repr(second)))
260260

261261
class Rewriter:
262262
"""

0 commit comments

Comments
 (0)