MCPcopy Index your code
hub / github.com/aws/aws-cli / bytes_print

Function bytes_print

awscli/compat.py:220–232  ·  view source on GitHub ↗

This function is used to write raw bytes to stdout.

(statement, stdout=None)

Source from the content-addressed store, hash-verified

218
219
220def bytes_print(statement, stdout=None):
221 """
222 This function is used to write raw bytes to stdout.
223 """
224 if stdout is None:
225 stdout = sys.stdout
226
227 if getattr(stdout, 'buffer', None):
228 stdout.buffer.write(statement)
229 else:
230 # If it is not possible to write to the standard out buffer.
231 # The next best option is to decode and write to standard out.
232 stdout.write(statement.decode('utf-8'))
233
234
235def get_stdout_text_writer():

Callers 1

writeMethod · 0.90

Calls 2

decodeMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected