From 8eec1e5e116feaaa1587a37b5974d664728fff51 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 9 Jan 2013 11:26:00 -0500 Subject: [PATCH] Fixes #57 Don't allow for ignore to be None --- flake8/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flake8/util.py b/flake8/util.py index 49042d6..c8188ce 100644 --- a/flake8/util.py +++ b/flake8/util.py @@ -49,8 +49,9 @@ def get_parser(): def skip_warning(warning, ignore=[]): # XXX quick dirty hack, just need to keep the line in the warning - if not hasattr(warning, 'message'): + if not hasattr(warning, 'message') or ignore is None: # McCabe's warnings cannot be skipped afaik, and they're all strings. + # And we'll get a TypeError otherwise return False if warning.message.split()[0] in ignore: return True