/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/strace.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Support for running strace against the current process."""
19
19
 
 
20
from __future__ import absolute_import
 
21
 
20
22
import os
21
23
import signal
22
24
import subprocess
42
44
 
43
45
    # capture strace output to a file
44
46
    log_file = tempfile.NamedTemporaryFile()
 
47
    log_file_fd = log_file.fileno()
45
48
    err_file = tempfile.NamedTemporaryFile()
46
49
    pid = os.getpid()
47
50
    # start strace
54
57
                            stdout=subprocess.PIPE,
55
58
                            stderr=err_file.fileno())
56
59
    # Wait for strace to attach
57
 
    proc.stdout.readline()
 
60
    attached_notice = proc.stdout.readline()
58
61
    # Run the function to strace
59
62
    result = function(*args, **kwargs)
60
63
    # stop strace
75
78
 
76
79
 
77
80
class StraceError(errors.BzrError):
78
 
 
 
81
    
79
82
    _fmt = "strace failed: %(err_messages)s"
80
83
 
81
84
 
89
92
        """
90
93
        self.raw_log = raw_log
91
94
        self.err_messages = err_messages
 
95
 
 
96