mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-05-18 13:39:55 -04: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user