/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: 2020-05-06 02:13:25 UTC
  • mfrom: (7490.7.21 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200506021325-awbmmqu1zyorz7sj
Merge 3.1 branch.

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