MCPcopy Create free account
hub / github.com/celery/celery / WhateverIO

Class WhateverIO

celery/utils/text.py:199–208  ·  view source on GitHub ↗

StringIO that takes bytes or str.

Source from the content-addressed store, hash-verified

197
198
199class WhateverIO(StringIO):
200 """StringIO that takes bytes or str."""
201
202 def __init__(
203 self, v: bytes | str | None = None, *a: Any, **kw: Any) -> None:
204 _SIO_init(self, v.decode() if isinstance(v, bytes) else v, *a, **kw)
205
206 def write(self, data: bytes | str) -> int:
207 return _SIO_write(self, data.decode()
208 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