From 3ef889bccf51f3cbb98079f669f3b01b40d07a18 Mon Sep 17 00:00:00 2001 From: Miro <200482516+Mirochill@users.noreply.github.com> Date: Mon, 25 May 2026 20:37:32 +0200 Subject: [PATCH] Handle missing curses in radar command --- shodan/__main__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shodan/__main__.py b/shodan/__main__.py index 4093b94..576c3e5 100644 --- a/shodan/__main__.py +++ b/shodan/__main__.py @@ -929,10 +929,13 @@ def radar(): key = get_api_key() api = shodan.Shodan(key) - from shodan.cli.worldmap import launch_map - try: + from shodan.cli.worldmap import launch_map launch_map(api) + except ImportError as e: + if getattr(e, 'name', None) in ('curses', '_curses') or 'curses' in str(e): + raise click.ClickException('The radar command requires Python curses support. On Windows, install windows-curses and try again.') + raise except shodan.APIError as e: raise click.ClickException(e.value) except Exception as e: