Commit b9ca3c7
committed
Fix for for python >= 3.11
Until python 3.11 IntEnum.srt() returned "<Enum name>.<member name>"
But since then it returns the string of its numeric value instead.
This causes errors like:
File "edtt/src/components/attdata.py", line 374, in __str__
result = self.__opcodeName( opcode );
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "edtt/src/components/attdata.py", line 349, in __opcodeName
result = result.split('.')[1];
~~~~~~~~~~~~~~~~~^^^
Let's pick the "name" instead which is directly the Enum member name.
This works both with newer and older python versions since enum was
added in version 3.4.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>1 parent fe9b1d1 commit b9ca3c7
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
| 342 | + | |
344 | 343 | | |
345 | 344 | | |
346 | 345 | | |
347 | 346 | | |
348 | | - | |
349 | | - | |
| 347 | + | |
350 | 348 | | |
351 | 349 | | |
352 | 350 | | |
| |||
0 commit comments