Skip to content

Commit

Permalink
Fix IntEnum tag usage (#56)
Browse files Browse the repository at this point in the history
IntEnum were being converted to strings in `fix_tag` which caused issues when sourcing FIX tags from an IntEnum using Python3 prior to 3.11.
  • Loading branch information
reprographix authored Sep 8, 2023
1 parent 4aa0e72 commit 0ea045b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simplefix/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def fix_tag(value):
if sys.version_info[0] == 2:
return bytes(value)

if hasattr(value, '__int__'):
return str(int(value)).encode('ASCII')

if type(value) is bytes:
return value

Expand Down

0 comments on commit 0ea045b

Please sign in to comment.