From caab4bd18d702afc430bb05032cdb6b71e5482f9 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Mon, 19 Nov 2012 21:39:57 -0500 Subject: [PATCH] Fixes #41 Seems like the patch that fixed skipping some warnings broke this. --- flake8/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake8/util.py b/flake8/util.py index 1cd61b0..8f1877d 100644 --- a/flake8/util.py +++ b/flake8/util.py @@ -5,6 +5,9 @@ import os def skip_warning(warning, ignore=[]): # XXX quick dirty hack, just need to keep the line in the warning + if not hasattr(warning, message): + # McCabe's warnings cannot be skipped afaik, and they're all strings. + return False if warning.message.split()[0] in ignore: return True if not os.path.isfile(warning.filename):