Skip to content

HP6632b.check_error_queue raises warning in Py37 #197

Description

@scasagrande

HP6632b.check_error_queue / hp6632b.py#L471 raises the following warning:

hp6632b.py:471: DeprecationWarning: using non-Enums in containment checks will raise TypeError in Python 3.8

On this line we are doing this:

err in self.ErrorCodes

where err is an int.

This should be changed to:

err in set(item.value for item in self.ErrorCodes)

or we can add a class method to the enum:

@classmethod
def has_value(cls, value):
    return any(value == item.value for item in cls)

We can even do a lazy-cache for this set to avoid regeneration on every HP6632b.check_error_queue call

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions