Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix enum.Flag issue occuring with Python3.11.1 #413

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

Kane610
Copy link
Owner

@Kane610 Kane610 commented Feb 14, 2023

❯ pytest --cov-report term-missing --cov=pydeconz tests/ ImportError while loading conftest '/Users/robban/Development/deconz/tests/conftest.py'.
tests/conftest.py:10: in
from pydeconz import DeconzSession
pydeconz/init.py:2: in
from .gateway import DeconzSession # noqa: F401
pydeconz/gateway.py:12: in
from .interfaces.alarm_systems import AlarmSystems
pydeconz/interfaces/alarm_systems.py:6: in
from ..models.alarm_system import (
pydeconz/models/alarm_system.py:46: in
class AlarmSystemArmMask(enum.Flag):
/opt/homebrew/Cellar/python@3.11/3.11.2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:560: in new
raise exc
/opt/homebrew/Cellar/python@3.11/3.11.2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:300: in set_name
and _is_single_bit(value)
/opt/homebrew/Cellar/python@3.11/3.11.2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:98: in _is_single_bit
num &= num - 1
E TypeError: unsupported operand type(s) for -: 'str' and 'int'

❯ pytest --cov-report term-missing --cov=pydeconz tests/
ImportError while loading conftest '/Users/robban/Development/deconz/tests/conftest.py'.
tests/conftest.py:10: in <module>
    from pydeconz import DeconzSession
pydeconz/__init__.py:2: in <module>
    from .gateway import DeconzSession  # noqa: F401
pydeconz/gateway.py:12: in <module>
    from .interfaces.alarm_systems import AlarmSystems
pydeconz/interfaces/alarm_systems.py:6: in <module>
    from ..models.alarm_system import (
pydeconz/models/alarm_system.py:46: in <module>
    class AlarmSystemArmMask(enum.Flag):
/opt/homebrew/Cellar/python@3.11/3.11.2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:560: in __new__
    raise exc
/opt/homebrew/Cellar/python@3.11/3.11.2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:300: in __set_name__
    and _is_single_bit(value)
/opt/homebrew/Cellar/python@3.11/3.11.2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:98: in _is_single_bit
    num &= num - 1
E   TypeError: unsupported operand type(s) for -: 'str' and 'int'
@Kane610 Kane610 merged commit b6f0d3d into master Feb 14, 2023
@Kane610 Kane610 deleted the fix_python3.11.1_enum_flag_issue branch February 14, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant