From 6dacab9848ca3cf0cb6cd2d94914d1609d651169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Mar=C3=ADa=20Mart=C3=ADnez=20G=C3=B3mez?= Date: Tue, 7 Jul 2020 18:54:36 +0200 Subject: [PATCH] Fix description ``` s = 'number: 4 = I am a description with an = yes' s.rpartition(' = ') => ('4 = I am a description with an', ' = ', 'yes') s.partition(' = ') => ('4', ' = ', 'I am a description with an = yes') s.split(' = ', 1) => ['4', 'I am a description with an = yes'] ``` --- capa/rules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capa/rules.py b/capa/rules.py index 09508df2..e30309ea 100644 --- a/capa/rules.py +++ b/capa/rules.py @@ -224,7 +224,7 @@ def parse_description(s, value_type, description=None): 'unexpected value: "%s", only one description allowed (inline description with `%s`)' % (s, DESCRIPTION_SEPARATOR) ) - value, _, description = s.rpartition(DESCRIPTION_SEPARATOR) + value, _, description = s.partition(DESCRIPTION_SEPARATOR) if description == "": raise InvalidRule('unexpected value: "%s", description cannot be empty' % s) else: