Skip to content

Commit 70fab2c

Browse files
committed
Some warning fixes
1 parent 7abce3a commit 70fab2c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

reportportal_client/logs/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from six import PY2
1919
from six.moves.urllib.parse import urlparse
2020

21+
# noinspection PyProtectedMember
2122
from reportportal_client._local import current
2223
from reportportal_client.helpers import timestamp
2324

@@ -137,8 +138,9 @@ def filter(self, record):
137138
# Filter the reportportal_client requests instance
138139
# urllib3 usage
139140
hostname = urlparse(self.endpoint).hostname
140-
if hostname in self.format(record):
141-
return False
141+
if hostname:
142+
if hostname.decode() in self.format(record):
143+
return False
142144
return True
143145

144146
def _get_rp_log_level(self, levelno):
@@ -159,6 +161,7 @@ def emit(self, record):
159161
"""
160162
msg = ''
161163

164+
# noinspection PyBroadException
162165
try:
163166
msg = self.format(record)
164167
except (KeyboardInterrupt, SystemExit):

0 commit comments

Comments
 (0)