MCPcopy
hub / github.com/celery/celery / _format_chars

Function _format_chars

celery/utils/saferepr.py:141–146  ·  view source on GitHub ↗
(val, maxlen)

Source from the content-addressed store, hash-verified

139
140
141def _format_chars(val, maxlen):
142 # type: (AnyStr, int) -> str
143 if isinstance(val, bytes): # pragma: no cover
144 return _format_binary_bytes(val, maxlen)
145 else:
146 return "'{}'".format(truncate(val, maxlen).replace("'", "\\'"))
147
148
149def _repr(obj):

Callers 1

_safereprFunction · 0.85

Calls 4

_format_binary_bytesFunction · 0.85
truncateFunction · 0.85
formatMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected