Skip to content

talon.ui.Rect.__eq__ throws Attribute Error when one argument is None #191

Description

@fmagin

This seems to be a bug introduced with 0.1.3.

Easily reproducible PoC:

from talon.ui import Rect
r = Rect(0,0,1,1)
r == None

Result:

$ .talon/bin/repl
Talon REPL | Python 3.9.1 (default, Dec 11 2020, 06:21:58) [GCC 7.5.0] on linux)
>>> from talon.ui import Rect
>>> r = Rect(0,0,1,1)
>>> r == None
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "talon/skia/rect.py", line 57, in __eq__
AttributeError: 'NoneType' object has no attribute 'x'
>>> None == r
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "talon/skia/rect.py", line 57, in __eq__
AttributeError: 'NoneType' object has no attribute 'x'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions