From 88f23594e2a030054ea2b5c2299bdc637f60469e Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 26 Nov 2017 09:06:35 -0800 Subject: [PATCH] Comply with flake8-import-order Fixes errors: src/flake8/__init__.py:22:1: I202 Additional newline in a section of imports. tests/unit/test_setuptools_command.py:4:1: I202 Additional newline in a section of imports. For src/flake8/__init__.py, simply remove the Python 2.6 workaround. logging.NullHandler is available on all supported Python versions. --- src/flake8/__init__.py | 15 ++------------- tests/unit/test_setuptools_command.py | 1 - 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/flake8/__init__.py b/src/flake8/__init__.py index efb711c..2ecf0cd 100644 --- a/src/flake8/__init__.py +++ b/src/flake8/__init__.py @@ -10,22 +10,11 @@ This module """ import logging -try: - 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 -LOG = logging.getLogger(__name__) -LOG.addHandler(NullHandler()) -# Clean up after LOG config -del NullHandler +LOG = logging.getLogger(__name__) +LOG.addHandler(logging.NullHandler()) __version__ = '3.5.0' __version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit()) diff --git a/tests/unit/test_setuptools_command.py b/tests/unit/test_setuptools_command.py index 40c9733..1c52b2a 100644 --- a/tests/unit/test_setuptools_command.py +++ b/tests/unit/test_setuptools_command.py @@ -1,6 +1,5 @@ """Module containing tests for the setuptools command integration.""" import pytest - from setuptools import dist from flake8.main import setuptools_command