8000 fix deprecation warnings of 'python -3' · haje01/fluent-logger-python@4c87626 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c87626

Browse files
committed
fix deprecation warnings of 'python -3'
1 parent b210255 commit 4c87626

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fluent/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ class Event:
44
def __init__(self, label, data, **kwargs):
55
if not isinstance(data, dict) :
66
raise Exception("data must be dict")
7-
l = kwargs.has_key("logger") and kwargs['logger'] or logger.get_global_logger()
7+
l = ('logger' in kwargs) and kwargs['logger'] or logger.get_global_logger()
88
l.emit(label, data)

fluent/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
global_logger = None
1111

1212
def setup(tag, **kwargs):
13-
host = kwargs.has_key("host") and kwargs['host'] or 'localhost'
14-
port = kwargs.has_key("port") and kwargs['port'] or 24224
13+
host = ('host' in kwargs) and kwargs['host'] or 'localhost'
14+
port = ('port' in kwargs) and kwargs['port'] or 24224
1515

1616
global global_logger
1717
global_logger = FluentLogger(tag, host=host, port=port)

0 commit comments

Comments
 (0)
0