depot_tools: Make gclient Python3 compatible.

Bug: 984182
Change-Id: Idc38678acbfca9cc6b89d77db28fdc24784f2b7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1753742
Commit-Queue: Edward Lemur <ehmaldonado@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
diff --git a/gclient_utils.py b/gclient_utils.py
index 227ce05..45617df 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -165,6 +165,9 @@
 
 
 def FileRead(filename, mode='rU'):
+  # On Python 3 newlines are converted to '\n' by default and 'U' is deprecated.
+  if mode == 'rU' and sys.version_info.major == 3:
+    mode = 'r'
   with open(filename, mode=mode) as f:
     # codecs.open() has different behavior than open() on python 2.6 so use
     # open() and decode manually.