diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2016-07-08 16:33:27 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-07-08 16:33:27 +0100 |
commit | b9f27a1e219e03af05042fb296b81a746e3bbd2a (patch) | |
tree | 343065bac00646e81e539810d0cd6a5ec30bf090 | |
parent | e4a1289eaf3e5a100ccff95658061ba82eb36030 (diff) | |
download | pylint-git-b9f27a1e219e03af05042fb296b81a746e3bbd2a.tar.gz |
Do not crash when printing the help of options with default regular expressions
Close #990
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | pylint/test/test_self.py | 4 | ||||
-rw-r--r-- | pylint/utils.py | 2 |
3 files changed, 14 insertions, 1 deletions
@@ -2,6 +2,15 @@ Pylint NEWS ----------- +What's new in Pylint 1.6.2? +=========================== + +Release date: TBA + + * Do not crash when printing the help of options with default regular expressions + + Close #990 + What's new in Pylint 1.6.1? =========================== diff --git a/pylint/test/test_self.py b/pylint/test/test_self.py index 748d81a9f..2d85bddbe 100644 --- a/pylint/test/test_self.py +++ b/pylint/test/test_self.py @@ -345,6 +345,10 @@ class RunTC(unittest.TestCase): self._test_output([path, "--rcfile=%s" % config_path], expected_output=expected) + def test_no_crash_with_formatting_regex_defaults(self): + self._runtest(["--ignore-patterns=a"], reporter=TextReporter(six.StringIO()), + code=32) + if __name__ == '__main__': unittest.main() diff --git a/pylint/utils.py b/pylint/utils.py index 75e0ff3c9..a4152c8d2 100644 --- a/pylint/utils.py +++ b/pylint/utils.py @@ -1089,7 +1089,7 @@ def _comment(string): def _format_option_value(optdict, value): """return the user input's value from a 'compiled' value""" if isinstance(value, (list, tuple)): - value = ','.join(value) + value = ','.join(_format_option_value(optdict, item) for item in value) elif isinstance(value, dict): value = ','.join('%s:%s' % (k, v) for k, v in value.items()) elif hasattr(value, 'match'): # optdict.get('type') == 'regexp' |