pre-upload: check for builtins module too

Python 3 has renamed this module, so tweak the check.

TEST=`repo upload` works with python3

Change-Id: I18a6117101a114612fd28a1b0c9684cd29e2c15c
Tested-by: Mike Frysinger <>
Commit-Ready: Mike Frysinger <>
Legacy-Commit-Queue: Commit Bot <>
Reviewed-by: Will Bradley <>
diff --git a/ b/
index 43248bb..bbbac61 100755
--- a/
+++ b/
@@ -33,7 +33,8 @@
 # that directory, so add it to our path.  This works whether we're running the
 # repo in $CHROMEOS_CHECKOUT/.repo/repo/ or a custom version in a completely
 # different tree.
-if __name__ == '__builtin__':
+# TODO(vapier): Python 2 used "__builtin__" while Python 3 uses "builtins".
+if __name__ in ('__builtin__', 'builtins'):
   sys.path.insert(0, os.getcwd())
 # If we're run directly, we'll find chromite relative to the repohooks dir in