MCPcopy Index your code
hub / github.com/python/cpython / init_streams

Function init_streams

Lib/_android_support.py:26–33  ·  view source on GitHub ↗
(android_log_write, stdout_prio, stderr_prio)

Source from the content-addressed store, hash-verified

24# redirect them to the system log using a pipe, but that wouldn't be convenient
25# or appropriate for all apps. So we redirect at the Python level instead.
26def init_streams(android_log_write, stdout_prio, stderr_prio):
27 if sys.executable:
28 return # Not embedded in an app.
29
30 global logcat
31 logcat = Logcat(android_log_write)
32 sys.stdout = TextLogStream(stdout_prio, "python.stdout", sys.stdout)
33 sys.stderr = TextLogStream(stderr_prio, "python.stderr", sys.stderr)
34
35
36class TextLogStream(io.TextIOWrapper):

Callers

nothing calls this directly

Calls 2

LogcatClass · 0.85
TextLogStreamClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…