mirror of
https://github.com/PyCQA/flake8.git
synced 2026-07-03 02:19:30 +00:00
Remove Python 2.6 logging.NullHandler workaround
All supported Python versions have support logging.NullHandler as it was added in Python 2.7. See: https://docs.python.org/2/library/logging.handlers.html#logging.NullHandler
This commit is contained in:
parent
696063ed1a
commit
0ad403f3a3
1 changed files with 2 additions and 14 deletions
|
|
@ -10,22 +10,10 @@ This module
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
try:
|
import sys
|
||||||
from logging import NullHandler
|
|
||||||
except ImportError:
|
|
||||||
class NullHandler(logging.Handler):
|
|
||||||
"""Shim for version of Python < 2.7."""
|
|
||||||
|
|
||||||
def emit(self, record):
|
|
||||||
"""Do nothing."""
|
|
||||||
pass
|
|
||||||
import sys # noqa: I202
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
LOG.addHandler(NullHandler())
|
LOG.addHandler(logging.NullHandler())
|
||||||
|
|
||||||
# Clean up after LOG config
|
|
||||||
del NullHandler
|
|
||||||
|
|
||||||
__version__ = '3.5.0'
|
__version__ = '3.5.0'
|
||||||
__version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit())
|
__version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue