1.1 --- a/MoinMessage.py Sat Jul 20 01:53:37 2013 +0200
1.2 +++ b/MoinMessage.py Sun Jul 21 21:30:53 2013 +0200
1.3 @@ -196,34 +196,17 @@
1.4
1.5 cmd = Popen(["gpg"] + self.conf_args + list(args), stdin=PIPE, stdout=PIPE, stderr=PIPE)
1.6
1.7 - try:
1.8 - # Attempt to write input to the command and to read output from the
1.9 - # command.
1.10 + # Attempt to write input to the command and to read output from the
1.11 + # command.
1.12
1.13 - try:
1.14 - if text:
1.15 - cmd.stdin.write(text)
1.16 - cmd.stdin.close()
1.17 -
1.18 - text = cmd.stdout.read()
1.19 -
1.20 - # I/O errors can indicate the failure of the command.
1.21 + text, self.errors = cmd.communicate(text)
1.22
1.23 - except IOError:
1.24 - pass
1.25 -
1.26 - self.errors = cmd.stderr.read()
1.27 -
1.28 - # Test for a zero result.
1.29 + # Test for a zero result.
1.30
1.31 - if not cmd.wait():
1.32 - return text
1.33 - else:
1.34 - raise MoinMessageError, self.errors
1.35 -
1.36 - finally:
1.37 - cmd.stdout.close()
1.38 - cmd.stderr.close()
1.39 + if not cmd.returncode:
1.40 + return text
1.41 + else:
1.42 + raise MoinMessageError, self.errors
1.43
1.44 def verifyMessageText(self, signature, content):
1.45