Merge branch 'topic/max-line-length' of git://github.com/treyhunner/pep8
authorFlorent Xicluna <florent.xicluna@gmail.com>
Mon, 26 Mar 2012 01:12:36 +0000 (03:12 +0200)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Mon, 26 Mar 2012 01:12:36 +0000 (03:12 +0200)
1  2 
pep8.py

diff --cc pep8.py
index 88d2f7d15be84de9807d69f10099873aa435e279,6afe6bc392e22c50299d62119df2f1a38c353adb..1c09695b9dbb4cf54dbe5ab2e6354fda95c20fda
+++ b/pep8.py
@@@ -248,10 -248,11 +248,11 @@@ def maximum_line_length(physical_line)
              if not hasattr(line, 'decode'):   # Python 3
                  line = line.encode('latin-1')
              length = len(line.decode('utf-8'))
 -        except UnicodeDecodeError:
 +        except UnicodeError:
              pass
-     if length > MAX_LINE_LENGTH:
-         return MAX_LINE_LENGTH, "E501 line too long (%d characters)" % length
+     if length > options.max_line_length:
+         return options.max_line_length, \
+             "E501 line too long (%d characters)" % length
  
  
  ##############################################################################