Skip to content

Conversation

dveselov
Copy link
Contributor

Hi!

Looks like that there is a typo (because dictionary lookup code, in that case, can't raise TypeError)

@isaulv
Copy link
Contributor

isaulv commented Apr 12, 2017

@dveselov Thank you for your contribution!
Actually we can improve this code and save a few precious microseconds with this change, remove the try/except and replace it with:
message = message.get('message')

try:
message = message['message']
except TypeError:
except KeyError:
Copy link
Member

Choose a reason for hiding this comment

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

could you change this to instead of being a try.. except be

message = message.get('message')

@dveselov
Copy link
Contributor Author

Done.

message = message['message']
except TypeError:
message = None
message = message.get('message', None)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend to leave out None because None is already the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

uh, ok.

@AutomatedTester AutomatedTester merged commit 3de9df1 into SeleniumHQ:master Apr 12, 2017
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.

3 participants