(text, limit=EXCERPT_CHARS)
| 109 | |
| 110 | |
| 111 | def excerpt(text, limit=EXCERPT_CHARS): |
| 112 | if isinstance(text, bytes): |
| 113 | text = text.decode("utf-8", "replace") |
| 114 | if len(text) <= limit: |
| 115 | return text |
| 116 | return "...(%d chars elided)...\n%s" % (len(text) - limit, text[-limit:]) |
| 117 | |
| 118 | |
| 119 | def kill_pid(pid): |
no outgoing calls
no test coverage detected