Skip to content

Commit ced9edb

Browse files
author
Dan
committed
Added check for null handler being available, updated docstrings and notice.
1 parent 59fcd93 commit ced9edb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pssh/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
AuthenticationException, ConnectionErrorException, SSHException
3838

3939
host_logger = logging.getLogger('pssh.host_logger')
40-
host_logger.addHandler(logging.NullHandler())
4140
logger = logging.getLogger('pssh')
42-
logger.addHandler(logging.NullHandler())
41+
if hasattr(logging, 'NullHandler'):
42+
host_logger.addHandler(logging.NullHandler())
43+
logger.addHandler(logging.NullHandler())

pssh/ssh_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is part of parallel-ssh.
22

3-
# Copyright (C) 2015- Panos Kittenis
3+
# Copyright (C) 2014-2017 Panos Kittenis
44

55
# This library is free software; you can redistribute it and/or
66
# modify it under the terms of the GNU Lesser General Public
@@ -273,7 +273,8 @@ def read_output_buffer(self, output_buffer, prefix='',
273273
:param callback: Function to call back once buffer is depleted:
274274
:type callback: function
275275
:param callback_args: Arguments for call back function
276-
:type callback_args: tuple"""
276+
:type callback_args: tuple
277+
"""
277278
for line in output_buffer:
278279
output = line.strip().decode(encoding)
279280
host_logger.info("[%s]%s\t%s", self.host, prefix, output,)

0 commit comments

Comments
 (0)