Skip to content

Commit 1cf4c52

Browse files
committed
workaround the logger being called without a structured message
1 parent e208fe4 commit 1cf4c52

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/support/loggersupp.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,14 @@ def warning(self, line):
101101

102102
def write(self, message):
103103
"""Actual write handler"""
104-
channel, namespace, specifics = message.split(':', 2)
104+
105+
try:
106+
channel, namespace, specifics = message.split(':', 2)
107+
except ValueError:
108+
# no channel on sme Python versions
109+
channel = 'ERROR'
110+
namespace = ''
111+
specifics = message
105112

106113
# ignore everything except warnings sent by the python runtime
107114
if not (channel == 'WARNING' and namespace == 'py.warnings'):

0 commit comments

Comments
 (0)