Modified: trunk/Tools/ChangeLog (290460 => 290461)
--- trunk/Tools/ChangeLog 2022-02-24 21:59:05 UTC (rev 290460)
+++ trunk/Tools/ChangeLog 2022-02-24 22:23:49 UTC (rev 290461)
@@ -1,5 +1,15 @@
2022-02-24 Jonathan Bedard <[email protected]>
+ [Python3] Make report-non-inclusive-language Python 3 compatible
+ https://bugs.webkit.org/show_bug.cgi?id=237154
+ <rdar://problem/89434987>
+
+ Reviewed by Aakash Jain.
+
+ * Scripts/report-non-inclusive-language: Make Python 3 compatible.
+
+2022-02-24 Jonathan Bedard <[email protected]>
+
[Python3] Migrate Tools/CISupport to Python3
https://bugs.webkit.org/show_bug.cgi?id=237148
<rdar://problem/89430395>
Modified: trunk/Tools/Scripts/report-non-inclusive-language (290460 => 290461)
--- trunk/Tools/Scripts/report-non-inclusive-language 2022-02-24 21:59:05 UTC (rev 290460)
+++ trunk/Tools/Scripts/report-non-inclusive-language 2022-02-24 22:23:49 UTC (rev 290461)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright (C) 2020 Apple Inc. All rights reserved.
#
@@ -36,9 +36,9 @@
# Hard-coded for now, could read these out of a file instead.
# Term, then the regular _expression_ for that term.
nonInclusiveTerms = [
- [ "blacklist", "black ?list" ],
- [ "whitelist", "white ?list" ],
- [ "slave", "slave" ]
+ [ "blacklist", rb"black ?list" ],
+ [ "whitelist", rb"white ?list" ],
+ [ "slave", rb"slave" ]
]
IGNORE_DIRECTORIES = ['.svn', '.git', 'autoinstalled', 'buildstream', 'node_modules']
@@ -69,7 +69,7 @@
continue
if os.path.islink(os.path.join(subroot, file)):
continue
- handle = open(os.path.join(subroot, file), "r")
+ handle = open(os.path.join(subroot, file), "rb")
for line in handle.readlines():
for term in nonInclusiveTerms:
if re.search(term[1], line):