MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / _Py3Utf8Output

Class _Py3Utf8Output

lib/speed.py:164–178  ·  view source on GitHub ↗

UTF-8 encoded wrapper around stdout for py3, to override ASCII stdout

Source from the content-addressed store, hash-verified

162 from io import TextIOWrapper, FileIO
163
164 class _Py3Utf8Output(TextIOWrapper):
165 """UTF-8 encoded wrapper around stdout for py3, to override
166 ASCII stdout
167 """
168 def __init__(self, f, **kwargs):
169 buf = FileIO(f.fileno(), 'w')
170 super(_Py3Utf8Output, self).__init__(
171 buf,
172 encoding='utf8',
173 errors='strict'
174 )
175
176 def write(self, s):
177 super(_Py3Utf8Output, self).write(s)
178 self.flush()
179
180 _py3_print = getattr(builtins, 'print')
181 try:

Callers 1

speed.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected