Bug 220510 - [ews] Add python 3 support - part 1
Summary: [ews] Add python 3 support - part 1
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-11 06:59 PST by Aakash Jain
Modified: 2021-01-11 18:23 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.61 KB, patch)
2021-01-11 07:09 PST, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2021-01-11 06:59:55 PST
Add Python 3 support to ews code.
Comment 1 Aakash Jain 2021-01-11 07:09:52 PST
Created attachment 417377 [details]
Patch
Comment 2 EWS 2021-01-11 08:44:35 PST
Committed r271361: <https://trac.webkit.org/changeset/271361>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417377 [details].
Comment 3 Radar WebKit Bug Importer 2021-01-11 08:45:21 PST
<rdar://problem/72999194>
Comment 4 Alexey Proskuryakov 2021-01-11 16:55:54 PST
Comment on attachment 417377 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417377&action=review

> Tools/ChangeLog:3
> +        [ews] Add python 3 support - part 1

This looks like moving to python 3 while dropping python 2, was this the intention?

> Tools/CISupport/ews-build/email_unittest.py:41
> -            self.assertTrue(category in emails.keys())
> +            self.assertTrue(category in list(emails.keys()))

Is this actually necessary? I think that converting to a list just makes the code slower.

> Tools/CISupport/ews-build/loadConfig_unittest.py:95
> +                    self.assertTrue(value[0] in list(schedulers_to_buildername_map.keys()),

Ditto.
Comment 5 Aakash Jain 2021-01-11 18:23:23 PST
Comment on attachment 417377 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417377&action=review

>> Tools/ChangeLog:3
>> +        [ews] Add python 3 support - part 1
> 
> This looks like moving to python 3 while dropping python 2, was this the intention?

The intention was to make the code compatible with both python 2 and 3.

>> Tools/CISupport/ews-build/email_unittest.py:41
>> +            self.assertTrue(category in list(emails.keys()))
> 
> Is this actually necessary? I think that converting to a list just makes the code slower.

Not really. It makes the 2to3 tool happy though.
This is a very small dictionary, and that too in unit-tests, the performance difference wouldn't really be noticeable in this case.