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

Method events

Lib/test/support/strace_helper.py:36–50  ·  view source on GitHub ↗

Parse event_bytes data into system calls for easier processing. This assumes the program under inspection doesn't print any non-utf8 strings which would mix into the strace output.

(self)

Source from the content-addressed store, hash-verified

34 stderr: bytes
35
36 def events(self):
37 """Parse event_bytes data into system calls for easier processing.
38
39 This assumes the program under inspection doesn't print any non-utf8
40 strings which would mix into the strace output."""
41 decoded_events = self.event_bytes.decode('utf-8', 'surrogateescape')
42 matches = [
43 _syscall_regex.match(event)
44 for event in decoded_events.splitlines()
45 ]
46 return [
47 StraceEvent(match["syscall"],
48 [arg.strip() for arg in (match["args"].split(","))],
49 match["returncode"]) for match in matches if match
50 ]
51
52 def sections(self):
53 """Find all "MARK <X>" writes and use them to make groups of events.

Callers 2

sectionsMethod · 0.95
_can_straceFunction · 0.80

Calls 6

StraceEventClass · 0.85
decodeMethod · 0.45
matchMethod · 0.45
splitlinesMethod · 0.45
stripMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected