ivilata / pymultihash

Python implementation of the multihash specification
19 stars 8 forks source link

Fixed a TypeError in FuncReg.unregister #14

Closed odesenfans closed 2 years ago

odesenfans commented 2 years ago

Fixed an incorrect check of the code against the values defined in the Func enum. This check would trigger the following error:

TypeError: unsupported operand type(s) for 'in': 'int' and 'EnumMeta'

when checking the code.

ivilata commented 2 years ago

Thanks @odesenfans and sorry for the long delay, I have very little time left for this project.

It looks like, for X = enum.IntEnum('X', [('x', 1)]), 1 in X issues a DeprecationWarning in 3.7, a TypeError in >= 3.8, a deprecated TypeError in >= 3.10, and it looks like True in 3.12. :facepalm: See bpo#33217 and bpo#43957.

Tests reveal more, related errors. I'll fix them too.

odesenfans commented 2 years ago

No worries, thanks for looking into it!