Apologies if this is a duplicate post
I'm trying to help move Chromium off of Python 2 and I noticed that dawn has four PRESUBMIT.py files that are not tagged as running in Python 3. These are:
third_party\dawn\PRESUBMIT.py
third_party\dawn\infra\config\PRESUBMIT.py
third_party\dawn\src\dawn\node\PRESUBMIT.py
third_party\dawn\tools\PRESUBMIT.py
Since these scripts are run by depot_tools and also invoke functionality in depot_tools these are preventing depot_tools from being fully switched to Python 3. It's possible that this is not known to the team, although depot_tools should have been printing warnings for a while.
Telling depot_tools to invoke a particular PRESUBMIT.py file under Python 3 is as "simple" as adding this line, typically near the top:
USE_PYTHON3 = True
Some syntax fixes may be needed of course.
The next issue is that the PRESUBMIT.py script may be calling out to some child scripts and these scripts may be using Python 2. Unfortunately there are many ways to invoke a child script and there as many ways to control which version of Python is invoked. This bug comment covers most of them:
https://bugs.chromium.org/p/chromium/issues/detail?id=1313804#c61I'm happy to consult/review/whatever as needed, on the Python 3 migration and any presubmit questions in general. Apologies for the messiness. Some of it was inevitable, but there were also mistakes made along the way.