Bug 1597616 - make mozharness::lib python3 compatible r=aki
authorEdwin Takahashi <egao@mozilla.com>
Tue, 19 Nov 2019 20:13:46 +0000
changeset 502665 44e81675e7af8a7903d2b2f5323d6742405e55ab
parent 502664 2502070e103c48083ea54b0163ada03f891500b0
child 502666 c57ebfe0e074485896521f8db7d5299146c83924
push id36821
push userrmaries@mozilla.com
push dateWed, 20 Nov 2019 03:58:07 +0000
treeherdermozilla-central@34cf9c1d48c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki
bugs1597616
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1597616 - make mozharness::lib python3 compatible r=aki Changes: Use the appropriate input method depending on the version. As usual, sort the imports and auto format. Differential Revision: https://phabricator.services.mozilla.com/D53853
testing/mozharness/mozharness/lib/python/authentication.py
--- a/testing/mozharness/mozharness/lib/python/authentication.py
+++ b/testing/mozharness/mozharness/lib/python/authentication.py
@@ -30,18 +30,23 @@ def get_credentials():
             content = file_handler.read().splitlines()
 
         https_username = content[0].strip()
 
         if len(content) > 1:
             # We want to remove files which contain the password
             os.remove(CREDENTIALS_PATH)
     else:
-        https_username = \
-                raw_input("Please enter your full LDAP email address: ")
+        try:
+            input_method = raw_input
+        except NameError:
+            input_method = input
+
+        https_username = input_method(
+            "Please enter your full LDAP email address: ")
 
         with open(CREDENTIALS_PATH, "w+") as file_handler:
             file_handler.write("%s\n" % https_username)
 
         os.chmod(CREDENTIALS_PATH, 0o600)
 
     if not LDAP_PASSWORD:
         print("Please enter your LDAP password (we won't store it):")