Skip to content

Commit acc0c60

Browse files
committed
Remove logging.NullHandler definitions as we no longer support 2.7
1 parent d09639f commit acc0c60

File tree

24 files changed

+72
-360
lines changed

24 files changed

+72
-360
lines changed

client_cli/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
2323
"""
2424

25+
# Suppress log messages instead of raising exception if the program using the library
26+
# does not configure the logging system.
2527
import logging
26-
27-
try:
28-
from logging import NullHandler
29-
except ImportError:
30-
31-
class NullHandler(logging.Handler):
32-
"""Suppress log messages instead of raising exception if the program using the
33-
library does not configure the logging system."""
34-
35-
# noinspection PyMissingOrEmptyDocstring
36-
def emit(self, record):
37-
pass
38-
39-
40-
logging.getLogger(__name__).addHandler(NullHandler())
28+
logging.getLogger(__name__).addHandler(logging.NullHandler())

client_cli/src/d1_cli/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
2323
"""
2424

25+
# Suppress log messages instead of raising exception if the program using the library
26+
# does not configure the logging system.
2527
import logging
26-
27-
try:
28-
from logging import NullHandler
29-
except ImportError:
30-
31-
class NullHandler(logging.Handler):
32-
"""Suppress log messages instead of raising exception if the program using the
33-
library does not configure the logging system."""
34-
35-
# noinspection PyMissingOrEmptyDocstring
36-
def emit(self, record):
37-
pass
38-
39-
40-
logging.getLogger(__name__).addHandler(NullHandler())
28+
logging.getLogger(__name__).addHandler(logging.NullHandler())

client_onedrive/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
2323
"""
2424

25+
# Suppress log messages instead of raising exception if the program using the library
26+
# does not configure the logging system.
2527
import logging
26-
27-
try:
28-
from logging import NullHandler
29-
except ImportError:
30-
31-
class NullHandler(logging.Handler):
32-
"""Suppress log messages instead of raising exception if the program using the
33-
library does not configure the logging system."""
34-
35-
# noinspection PyMissingOrEmptyDocstring
36-
def emit(self, record):
37-
pass
38-
39-
40-
logging.getLogger(__name__).addHandler(NullHandler())
28+
logging.getLogger(__name__).addHandler(logging.NullHandler())

client_onedrive/src/d1_onedrive/impl/tests/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,7 @@
2424
2525
"""
2626

27+
# Suppress log messages instead of raising exception if the program using the library
28+
# does not configure the logging system.
2729
import logging
28-
29-
try:
30-
from logging import NullHandler
31-
except ImportError:
32-
33-
class NullHandler(logging.Handler):
34-
"""Suppress log messages instead of raising exception if the program using the
35-
library does not configure the logging system."""
36-
37-
# noinspection PyMissingOrEmptyDocstring
38-
def emit(self, record):
39-
pass
40-
41-
42-
logging.getLogger(__name__).addHandler(NullHandler())
30+
logging.getLogger(__name__).addHandler(logging.NullHandler())

dev_tools/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
2323
"""
2424

25+
# Suppress log messages instead of raising exception if the program using the library
26+
# does not configure the logging system.
2527
import logging
26-
27-
try:
28-
from logging import NullHandler
29-
except ImportError:
30-
31-
class NullHandler(logging.Handler):
32-
"""Suppress log messages instead of raising exception if the program using the
33-
library does not configure the logging system."""
34-
35-
# noinspection PyMissingOrEmptyDocstring
36-
def emit(self, record):
37-
pass
38-
39-
40-
logging.getLogger(__name__).addHandler(NullHandler())
28+
logging.getLogger(__name__).addHandler(logging.NullHandler())

dev_tools/src/d1_dev/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
2323
"""
2424

25+
# Suppress log messages instead of raising exception if the program using the library
26+
# does not configure the logging system.
2527
import logging
26-
27-
try:
28-
from logging import NullHandler
29-
except ImportError:
30-
31-
class NullHandler(logging.Handler):
32-
"""Suppress log messages instead of raising exception if the program using the
33-
library does not configure the logging system."""
34-
35-
# noinspection PyMissingOrEmptyDocstring
36-
def emit(self, record):
37-
pass
38-
39-
40-
logging.getLogger(__name__).addHandler(NullHandler())
28+
logging.getLogger(__name__).addHandler(logging.NullHandler())

gmn/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
2323
"""
2424

25+
# Suppress log messages instead of raising exception if the program using the library
26+
# does not configure the logging system.
2527
import logging
26-
27-
try:
28-
from logging import NullHandler
29-
except ImportError:
30-
31-
class NullHandler(logging.Handler):
32-
"""Suppress log messages instead of raising exception if the program using the
33-
library does not configure the logging system."""
34-
35-
# noinspection PyMissingOrEmptyDocstring
36-
def emit(self, record):
37-
pass
38-
39-
40-
logging.getLogger(__name__).addHandler(NullHandler())
28+
logging.getLogger(__name__).addHandler(logging.NullHandler())

gmn/src/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
2323
"""
2424

25+
# Suppress log messages instead of raising exception if the program using the library
26+
# does not configure the logging system.
2527
import logging
26-
27-
try:
28-
from logging import NullHandler
29-
except ImportError:
30-
31-
class NullHandler(logging.Handler):
32-
"""Suppress log messages instead of raising exception if the program using the
33-
library does not configure the logging system."""
34-
35-
# noinspection PyMissingOrEmptyDocstring
36-
def emit(self, record):
37-
pass
38-
39-
40-
logging.getLogger(__name__).addHandler(NullHandler())
28+
logging.getLogger(__name__).addHandler(logging.NullHandler())

lib_client/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
2323
"""
2424

25+
# Suppress log messages instead of raising exception if the program using the library
26+
# does not configure the logging system.
2527
import logging
26-
27-
try:
28-
from logging import NullHandler
29-
except ImportError:
30-
31-
class NullHandler(logging.Handler):
32-
"""Suppress log messages instead of raising exception if the program using the
33-
library does not configure the logging system."""
34-
35-
# noinspection PyMissingOrEmptyDocstring
36-
def emit(self, record):
37-
pass
38-
39-
40-
logging.getLogger(__name__).addHandler(NullHandler())
28+
logging.getLogger(__name__).addHandler(logging.NullHandler())

lib_client/src/d1_client/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,7 @@
3636
3737
"""
3838

39+
# Suppress log messages instead of raising exception if the program using the library
40+
# does not configure the logging system.
3941
import logging
40-
41-
try:
42-
from logging import NullHandler
43-
except ImportError:
44-
45-
class NullHandler(logging.Handler):
46-
"""Suppress log messages instead of raising exception if the program using the
47-
library does not configure the logging system."""
48-
49-
# noinspection PyMissingOrEmptyDocstring
50-
def emit(self, record):
51-
pass
52-
53-
54-
logging.getLogger(__name__).addHandler(NullHandler())
42+
logging.getLogger(__name__).addHandler(logging.NullHandler())

0 commit comments

Comments
 (0)