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 a typo from on_trait_change to observe migration #1545

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

aaronayres35
Copy link
Contributor

In #1519 there was a typo that went unnoticed. The tests all still passed but in the test suite one could see the error

Exception occurred in traits notification handler for event object: TraitChangeEvent(object=<traitsui.key_bindings.KeyBindings object at 0x7f9344a73048>, name='children', old=[<traitsui.key_bindings.KeyBindings object at 0x7f935c6c6ca8>], new=[])
Traceback (most recent call last):
  File "/Users/aayres/Desktop/traits/traits/observation/_trait_event_notifier.py", line 122, in __call__
    self.dispatcher(handler, event)
  File "/Users/aayres/Desktop/traits/traits/observation/observe.py", line 26, in dispatch_same
    handler(event)
  File "/Users/aayres/Desktop/traitsui/traitsui/key_bindings.py", line 267, in _children_modified
    for item in event.added:
AttributeError: 'TraitChangeEvent' object has no attribute 'added'
.Exception occurred in traits notification handler for event object: TraitChangeEvent(object=<traitsui.key_bindings.KeyBindings object at 0x7f9344ac13b8>, name='children', old=[<traitsui.key_bindings.KeyBindings object at 0x7f934532edb0>], new=[])
Traceback (most recent call last):
  File "/Users/aayres/Desktop/traits/traits/observation/_trait_event_notifier.py", line 122, in __call__
    self.dispatcher(handler, event)
  File "/Users/aayres/Desktop/traits/traits/observation/observe.py", line 26, in dispatch_same
    handler(event)
  File "/Users/aayres/Desktop/traitsui/traitsui/key_bindings.py", line 267, in _children_modified
    for item in event.added:
AttributeError: 'TraitChangeEvent' object has no attribute 'added'

This was because the object is actually a KeyBindings not a KeyBinding so we ended up in the wrong conditional path.

@rahulporuri rahulporuri added this to In progress in Enthought OSS Q1 2021 Mar 22, 2021
Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit : The code change makes sense to me but I don't see any traceback when I run the testsuite on the main branch either. Not sure what's going on.

LGTM. I ran the testsuite locally and I dont see the traceback!

@aaronayres35
Copy link
Contributor Author

Edit : The code change makes sense to me but I don't see any traceback when I run the testsuite on the main branch either. Not sure what's going on.

See lines 597-615 in
log (4).txt (pulled from CI run on #1546
For an example of it occurring on CI

@aaronayres35 aaronayres35 merged commit f39caa8 into master Mar 22, 2021
Enthought OSS Q1 2021 automation moved this from In progress to Done Mar 22, 2021
@aaronayres35 aaronayres35 deleted the fix-on_trait_change-to-observe-mistake branch March 22, 2021 11:49
@rahulporuri rahulporuri moved this from Done to Sprint 5 : 15 March - 2 April 2021 in Enthought OSS Q1 2021 Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Enthought OSS Q1 2021
Sprint 5 : 15 March - 2 April 2021
Development

Successfully merging this pull request may close these issues.

None yet

2 participants