From d90d89aa8c0b23529565fa5ad235e064936c935f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 Dec 2015 17:01:11 +0530 Subject: [PATCH] ... --- setup/installer/windows/freeze.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/setup/installer/windows/freeze.py b/setup/installer/windows/freeze.py index 8757ce779c..d970438318 100644 --- a/setup/installer/windows/freeze.py +++ b/setup/installer/windows/freeze.py @@ -558,14 +558,18 @@ class Win32Freeze(Command, WixMixIn): args = ['signtool.exe', 'sign', '/a', '/fd', 'sha256', '/td', 'sha256', '/d', 'calibre - E-book management', '/du', 'http://calibre-ebook.com', '/tr'] - for timeserver in ('http://timestamp.geotrust.com/tsa', 'http://timestamp.comodoca.com/rfc3161',): - try: - subprocess.check_call(args + [timeserver] + files) - break - except subprocess.CalledProcessError: - print ('Signing failed, retrying with different timestamp server') - else: - raise SystemExit('Signing failed') + + def runcmd(cmd): + for timeserver in ('http://timestamp.geotrust.com/tsa', 'http://timestamp.comodoca.com/rfc3161',): + try: + subprocess.check_call(cmd + [timeserver] + files) + break + except subprocess.CalledProcessError: + print ('Signing failed, retrying with different timestamp server') + else: + raise SystemExit('Signing failed') + + runcmd(args) def add_dir_to_zip(self, zf, path, prefix=''): '''