(self, b)
| 119 | return True |
| 120 | |
| 121 | def write(self, b): |
| 122 | if type(b) is not bytes: |
| 123 | try: |
| 124 | b = bytes(memoryview(b)) |
| 125 | except TypeError: |
| 126 | raise TypeError( |
| 127 | f"write() argument must be bytes-like, not {type(b).__name__}" |
| 128 | ) from None |
| 129 | |
| 130 | # Writing an empty string to the stream should have no effect. |
| 131 | if b: |
| 132 | logcat.write(self.prio, self.tag, b) |
| 133 | return len(b) |
| 134 | |
| 135 | # This is needed by the test suite --timeout option, which uses faulthandler. |
| 136 | def fileno(self): |