From da2da758cd3fad3436efc62b61b4400dc71aca80 Mon Sep 17 00:00:00 2001 From: John Matherly Date: Thu, 4 Oct 2018 20:00:03 -0500 Subject: [PATCH] Release 1.10.4 Fix a bug when showing old banner records that don't have the "transport" property --- setup.py | 2 +- shodan/cli/host.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 125896c..ef991f1 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name = 'shodan', - version = '1.10.3', + version = '1.10.4', description = 'Python library and command-line utility for Shodan (https://developer.shodan.io)', long_description = README, long_description_content_type = 'text/x-rst', diff --git a/shodan/cli/host.py b/shodan/cli/host.py index fcd440f..befdc62 100644 --- a/shodan/cli/host.py +++ b/shodan/cli/host.py @@ -80,8 +80,9 @@ def host_print_pretty(host, history=False): version = '({})'.format(banner['version']) click.echo(click.style('{:>7d}'.format(banner['port']), fg='cyan'), nl=False) - click.echo('/', nl=False) - click.echo(click.style('{} '.format(banner['transport']), fg='yellow'), nl=False) + if 'transport' in banner: + click.echo('/', nl=False) + click.echo(click.style('{} '.format(banner['transport']), fg='yellow'), nl=False) click.echo('{} {}'.format(product, version), nl=False) if history: