diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2013-02-20 11:33:26 +0100 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2013-02-20 11:33:26 +0100 |
commit | 748a85fee8034fe87ce066141e8309c6792afb21 (patch) | |
tree | 8e49de6bdfbde7bc88feeddfc53c2bac72c5b195 | |
parent | 9bfc5d9ef1c8acf133aafce723e242dc91ccf41f (diff) | |
download | pylint-git-748a85fee8034fe87ce066141e8309c6792afb21.tar.gz |
don't reference sys.stdout as default argument value, so one may redirect sys.stdout to catch pylint output. For instance this properly silent smoke tests
-rw-r--r-- | reporters/text.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/reporters/text.py b/reporters/text.py index 26dbd6d93..1dde0de30 100644 --- a/reporters/text.py +++ b/reporters/text.py @@ -41,7 +41,7 @@ class TextReporter(BaseReporter): __implements__ = IReporter extension = 'txt' - def __init__(self, output=sys.stdout): + def __init__(self, output=None): BaseReporter.__init__(self, output) self._modules = {} @@ -73,7 +73,7 @@ class ParseableTextReporter(TextReporter): """ line_format = '%(path)s:%(line)s: [%(sigle)s%(obj)s] %(msg)s' - def __init__(self, output=sys.stdout, relative=True): + def __init__(self, output=None, relative=True): TextReporter.__init__(self, output) if relative: self._prefix = os.getcwd() + os.sep @@ -108,7 +108,7 @@ class ColorizedTextReporter(TextReporter): 'S' : ("yellow", "inverse"), # S stands for module Separator } - def __init__(self, output=sys.stdout, color_mapping = None): + def __init__(self, output=None, color_mapping=None): TextReporter.__init__(self, output) self.color_mapping = color_mapping or \ dict(ColorizedTextReporter.COLOR_MAPPING) |