Be less greedy while removing leading and trailing '!'

This commit is contained in:
Mathieu Comandon 2012-06-13 14:33:02 +02:00
parent fb9e19d11d
commit e5f644101d
1 changed files with 5 additions and 1 deletions

View File

@ -114,7 +114,11 @@ class Payment(PaymentCommon):
self.logger.debug('executing %s' % args)
result, _ = subprocess.Popen(args, executable=executable,
stdout=subprocess.PIPE, shell=True).communicate()
result = result.strip('!').split('!')
if result[0] == '!':
result = result[1:]
if result[-1] == '!':
result = result[:-1]
result = result.split('!')
self.logger.debug('got response %s' % result)
return result