diff --git a/flake8/mccabe.py b/flake8/mccabe.py index 87405d4..b693ca7 100644 --- a/flake8/mccabe.py +++ b/flake8/mccabe.py @@ -177,7 +177,7 @@ def get_code_complexity(code, min=7, filename='stdin'): try: ast = compiler.parse(code) except AttributeError as e: - print >>sys.stderr, "Unable to parse %s: %s" % (filename, e) + print >> sys.stderr, "Unable to parse %s: %s" % (filename, e) return 0 visitor = PathGraphingAstVisitor() diff --git a/flake8/pep8.py b/flake8/pep8.py index a6372d8..1ecb566 100644 --- a/flake8/pep8.py +++ b/flake8/pep8.py @@ -721,12 +721,14 @@ def python_3000_backticks(logical_line): if '' == ''.encode(): # Python 2: implicit encoding. + def readlines(filename): return open(filename).readlines() else: # Python 3: decode to latin-1. # This function is lazy, it does not read the encoding declaration. # XXX: use tokenize.detect_encoding() + def readlines(filename): # NOQA return open(filename, encoding='latin-1').readlines()