1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-07 09:50:07 +02:00

nightly: fix PEP8 E722 do not use bare except

This commit is contained in:
Hans-Christoph Steiner 2017-11-27 10:41:08 +01:00
parent 35ff37b1e2
commit ec453eac8a

View File

@ -159,7 +159,7 @@ def main():
logging.debug(_('cloning {url}').format(url=clone_url)) logging.debug(_('cloning {url}').format(url=clone_url))
try: try:
git.Repo.clone_from(clone_url, git_mirror_path) git.Repo.clone_from(clone_url, git_mirror_path)
except: except Exception:
pass pass
if not os.path.isdir(git_mirror_repodir): if not os.path.isdir(git_mirror_repodir):
os.makedirs(git_mirror_repodir, mode=0o755) os.makedirs(git_mirror_repodir, mode=0o755)
@ -192,7 +192,7 @@ Last updated: {date}'''.format(repo_git_base=repo_git_base,
img = qrcode.make('Some data here') img = qrcode.make('Some data here')
with open(icon_path, 'wb') as fp: with open(icon_path, 'wb') as fp:
fp.write(img) fp.write(img)
except: except Exception:
exampleicon = os.path.join(common.get_examples_dir(), 'fdroid-icon.png') exampleicon = os.path.join(common.get_examples_dir(), 'fdroid-icon.png')
shutil.copy(exampleicon, icon_path) shutil.copy(exampleicon, icon_path)
mirror_git_repo.git.add(all=True) mirror_git_repo.git.add(all=True)
@ -251,13 +251,13 @@ Last updated: {date}'''.format(repo_git_base=repo_git_base,
subprocess.check_call(['ssh', '-Tvi', ssh_private_key_file, subprocess.check_call(['ssh', '-Tvi', ssh_private_key_file,
'-oIdentitiesOnly=yes', '-oStrictHostKeyChecking=no', '-oIdentitiesOnly=yes', '-oStrictHostKeyChecking=no',
servergitmirror.split(':')[0]]) servergitmirror.split(':')[0]])
except: except subprocess.CalledProcessError:
pass pass
subprocess.check_call(['fdroid', 'update', '--rename-apks', '--verbose'], cwd=repo_basedir) subprocess.check_call(['fdroid', 'update', '--rename-apks', '--verbose'], cwd=repo_basedir)
try: try:
subprocess.check_call(['fdroid', 'server', 'update', '--verbose'], cwd=repo_basedir) subprocess.check_call(['fdroid', 'server', 'update', '--verbose'], cwd=repo_basedir)
except: except subprocess.CalledProcessError:
logging.error(_('cannot publish update, did you set the deploy key?') logging.error(_('cannot publish update, did you set the deploy key?')
+ '\n' + deploy_key_url) + '\n' + deploy_key_url)
sys.exit(1) sys.exit(1)