tools_webrtc dir converted to py3 + top level PRESUBMIT script

Bug: webrtc:13607
Change-Id: Ib018e43ea977cc24dd71048e68e3343741f7f31b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249083
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Christoffer Jansson <jansson@google.com>
Cr-Commit-Position: refs/heads/main@{#35953}
diff --git a/tools_webrtc/flags_compatibility.py b/tools_webrtc/flags_compatibility.py
index bdafefb..e7aeb93 100755
--- a/tools_webrtc/flags_compatibility.py
+++ b/tools_webrtc/flags_compatibility.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env vpython3
 
 # Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
 #
@@ -36,10 +36,11 @@
 def _ForcePythonInterpreter(cmd):
   """Returns the fixed command line to call the right python executable."""
   out = cmd[:]
-  if out[0] == 'python':
-    out[0] = sys.executable
-  elif out[0].endswith('.py'):
-    out.insert(0, sys.executable)
+  if len(out) > 0:
+    if out[0] == 'python':
+      out[0] = sys.executable
+    elif out[0].endswith('.py'):
+      out.insert(0, sys.executable)
   return out