mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
fix "fdroidserver/build.py:41: redefinition of unused 'paramiko' from line 39"
pyflakes gave this error based on the `paramiko = None` statement. I used a different way to test whether paramiko was successfully imported that is directly based on the relevant Exceptions.
This commit is contained in:
parent
17b7f192b5
commit
d564c37c35
1 changed files with 5 additions and 3 deletions
|
|
@ -37,8 +37,8 @@ from common import BuildException, VCSException, FDroidPopen, SilentPopen
|
|||
|
||||
try:
|
||||
import paramiko
|
||||
except:
|
||||
paramiko = None
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
def get_builder_vm_id():
|
||||
vd = os.path.join('builder', '.vagrant')
|
||||
|
|
@ -244,7 +244,9 @@ def release_vm():
|
|||
def build_server(app, thisbuild, vcs, build_dir, output_dir, force):
|
||||
"""Do a build on the build server."""
|
||||
|
||||
if not paramiko:
|
||||
try:
|
||||
paramiko
|
||||
except NameError:
|
||||
raise BuildException("Paramiko is required to use the buildserver")
|
||||
if options.verbose:
|
||||
logging.getLogger("paramiko").setLevel(logging.DEBUG)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue