Skip to content

Commit

Permalink
Remove NullHandler fallback logic
Browse files Browse the repository at this point in the history
Since we no longer support Python < 3.1 it can be removed

The NullHandler exists since Python 3.1
(https://docs.python.org/3/library/logging.handlers.html?highlight=nullhandler#nullhandler)
  • Loading branch information
mfussenegger committed Jul 12, 2019
1 parent 923c479 commit ebf0a03
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/crate/crash/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@
import re
import sys
import urllib3
from getpass import getpass

from appdirs import user_data_dir, user_config_dir
from argparse import ArgumentParser, ArgumentTypeError
from collections import namedtuple
from crate.client import connect
from crate.client.exceptions import ConnectionError, ProgrammingError
from distutils.version import StrictVersion
from urllib3.exceptions import LocationParseError
from getpass import getpass
from logging import NullHandler
from operator import itemgetter
from urllib3.exceptions import LocationParseError

from .commands import built_in_commands, Command
from .config import Configuration, ConfigurationError
Expand All @@ -47,19 +49,6 @@
from ..crash import __version__ as crash_version

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


try:
from logging import NullHandler
except ImportError:
from logging import Handler

class NullHandler(Handler):

def emit(self, record):
pass


logging.getLogger('crate').addHandler(NullHandler())

USER_DATA_DIR = user_data_dir("Crate", "Crate")
Expand Down

0 comments on commit ebf0a03

Please sign in to comment.