From a8577ad89451874ad4fa9bc8334b3f59629a3cd6 Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Tue, 19 Dec 2023 23:44:07 -0500 Subject: [PATCH] fix port parsing bug --- bbot/core/helpers/misc.py | 2 +- bbot/test/test_step_1/test_helpers.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bbot/core/helpers/misc.py b/bbot/core/helpers/misc.py index 1d3e321e2..a755f8693 100644 --- a/bbot/core/helpers/misc.py +++ b/bbot/core/helpers/misc.py @@ -2479,7 +2479,7 @@ def parse_port_string(port_string): >>> parse_port_string("invalid") ValueError: Invalid port or port range: invalid """ - elements = port_string.split(",") + elements = str(port_string).split(",") ports = [] for element in elements: diff --git a/bbot/test/test_step_1/test_helpers.py b/bbot/test/test_step_1/test_helpers.py index b27ab4577..7bc6c4bef 100644 --- a/bbot/test/test_step_1/test_helpers.py +++ b/bbot/test/test_step_1/test_helpers.py @@ -678,6 +678,7 @@ async def do_stuff(r): def test_portparse_singleports(helpers): assert helpers.parse_port_string("80,443,22") == [80, 443, 22] + assert helpers.parse_port_string(80) == [80] def test_portparse_range_valid(helpers):