From 959b66b26a368a08cafb2ecb879d212cf203d08c Mon Sep 17 00:00:00 2001 From: William Ballenthin Date: Mon, 6 Jul 2020 16:50:47 -0600 Subject: [PATCH] rules: use rpartition instead of split(..., 1) to better express intent --- capa/rules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capa/rules.py b/capa/rules.py index 6347f754..4ca42553 100644 --- a/capa/rules.py +++ b/capa/rules.py @@ -216,7 +216,7 @@ def parse_description(s, value_type, description=None): raise InvalidRule( 'unexpected value: "%s", only one description allowed (inline description with ` = `)' % s ) - value, description = s.split(" = ", 1) + value, _, description = s.rpartition(" = ") if description == "": raise InvalidRule('unexpected value: "%s", description cannot be empty' % s) else: