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.
try:
import paramiko
-except:
- paramiko = None
+except ImportError:
+ pass
def get_builder_vm_id():
vd = os.path.join('builder', '.vagrant')
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)