mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +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:
|
try:
|
||||||
import paramiko
|
import paramiko
|
||||||
except:
|
except ImportError:
|
||||||
paramiko = None
|
pass
|
||||||
|
|
||||||
def get_builder_vm_id():
|
def get_builder_vm_id():
|
||||||
vd = os.path.join('builder', '.vagrant')
|
vd = os.path.join('builder', '.vagrant')
|
||||||
|
|
@ -244,7 +244,9 @@ def release_vm():
|
||||||
def build_server(app, thisbuild, vcs, build_dir, output_dir, force):
|
def build_server(app, thisbuild, vcs, build_dir, output_dir, force):
|
||||||
"""Do a build on the build server."""
|
"""Do a build on the build server."""
|
||||||
|
|
||||||
if not paramiko:
|
try:
|
||||||
|
paramiko
|
||||||
|
except NameError:
|
||||||
raise BuildException("Paramiko is required to use the buildserver")
|
raise BuildException("Paramiko is required to use the buildserver")
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
logging.getLogger("paramiko").setLevel(logging.DEBUG)
|
logging.getLogger("paramiko").setLevel(logging.DEBUG)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue