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']
```
This commit is contained in:
Ana María Martínez Gómez
2020-07-07 18:54:36 +02:00
parent 4f61836d45
commit 6dacab9848

View File

@@ -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: