Skip to content

Commit 1f2d7b6

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

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
@@ -19,6 +19,14 @@
1919
except ImportError:
2020
from unittest2 import SkipTest
2121

22+
if not hasattr(logging, 'NullHandler'):
23+
class NullHandler(logging.Handler):
24+
def emit(self, record):
25+
pass
26+
27+
logging.NullHandler = NullHandler
28+
29+
2230
from gitdb.util import (# NOQA @IgnorePep8
2331
make_sha,
2432
LockedFD, # @UnusedImport

0 commit comments

Comments
 (0)