File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def _safe_exception_string(exception: BaseException) -> str:
145145 return exception .__class__ .__name__
146146
147147
148- def _coerce_json_safe (obj : _typing .Any ):
148+ def _coerce_json_safe (obj : _typing .Any ) -> _typing . Any :
149149 """
150150 Converts values that survive circular-reference removal into JSON-safe values.
151151 """
@@ -163,7 +163,7 @@ def _coerce_json_safe(obj: _typing.Any):
163163 return _safe_repr (obj )
164164
165165
166- def _coerce_json_safe_dict_key (obj : _typing .Any ):
166+ def _coerce_json_safe_dict_key (obj : _typing .Any ) -> _typing . Any :
167167 """
168168 Converts dictionary keys into values accepted by JSON object encoding.
169169 """
@@ -229,7 +229,7 @@ def _get_write_file(severity: LogSeverity) -> _typing.TextIO:
229229
230230def write (entry : LogEntry ) -> None :
231231 write_file = _get_write_file (entry ["severity" ])
232- print (_json .dumps (_remove_circular (entry ), ensure_ascii = False ), file = write_file )
232+ print (_json .dumps (_coerce_json_safe ( _remove_circular (entry ) ), ensure_ascii = False ), file = write_file )
233233
234234
235235def debug (* args , ** kwargs ) -> None :
You can’t perform that action at this time.
0 commit comments