MCPcopy
hub / github.com/celery/celery / WhateverIO

Class WhateverIO

celery/utils/text.py:189–198  ·  view source on GitHub ↗

StringIO that takes bytes or str.

Source from the content-addressed store, hash-verified

187
188
189class WhateverIO(StringIO):
190 """StringIO that takes bytes or str."""
191
192 def __init__(
193 self, v: bytes | str | None = None, *a: Any, **kw: Any) -> None:
194 _SIO_init(self, v.decode() if isinstance(v, bytes) else v, *a, **kw)
195
196 def write(self, data: bytes | str) -> int:
197 return _SIO_write(self, data.decode()
198 if isinstance(data, bytes) else data)

Callers 6

test_rdbMethod · 0.90
test_get_avail_portMethod · 0.90
test_write_pidMethod · 0.90
test_to_dotMethod · 0.90
cryFunction · 0.90

Calls

no outgoing calls

Tested by 5

test_rdbMethod · 0.72
test_get_avail_portMethod · 0.72
test_write_pidMethod · 0.72
test_to_dotMethod · 0.72