Skip to content

Commit 287bd9e

Browse files
committed
Fixed missing NullHanlder in Python 2.6
1 parent d17152c commit 287bd9e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

git/util.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
)
4242
from .exc import InvalidGitRepositoryError
4343

44+
45+
if not hasattr(logging, 'NullHandler'):
46+
class NullHandler(logging.Handler):
47+
def emit(self, record):
48+
pass
49+
50+
logging.NullHandler = NullHandler
51+
4452
log = logging.getLogger('git.util')
4553
log.addHandler(logging.NullHandler())
4654

0 commit comments

Comments
 (0)