~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/gpg.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""GPG signing and checking logic."""
19
19
 
 
20
import os
 
21
import sys
 
22
 
 
23
from bzrlib.lazy_import import lazy_import
 
24
lazy_import(globals(), """
20
25
import errno
21
 
import os
22
26
import subprocess
23
27
 
24
28
from bzrlib import (
26
30
    trace,
27
31
    ui,
28
32
    )
 
33
""")
29
34
 
30
35
 
31
36
class DisabledGPGStrategy(object):
72
77
 
73
78
    def sign(self, content):
74
79
        ui.ui_factory.clear_term()
 
80
 
 
81
        preexec_fn = _set_gpg_tty
 
82
        if sys.platform == 'win32':
 
83
            # Win32 doesn't support preexec_fn, but wouldn't support TTY anyway.
 
84
            preexec_fn = None
75
85
        try:
76
86
            process = subprocess.Popen(self._command_line(),
77
87
                                       stdin=subprocess.PIPE,
78
88
                                       stdout=subprocess.PIPE,
79
 
                                       preexec_fn=_set_gpg_tty)
 
89
                                       preexec_fn=preexec_fn)
80
90
            try:
81
91
                result = process.communicate(content)[0]
82
92
                if process.returncode is None: