Skip to content

Commit 64977e5

Browse files
Support python 2 and 3 (#20698)
1 parent 6e6cdb6 commit 64977e5

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

download-deps.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def __init__(self, workpath, config_path, version_path, remote_version_key=None)
107107
print("==> version file doesn't exist")
108108

109109
def get_input_value(self, prompt):
110-
ret = raw_input(prompt)
110+
if sys.version_info[0] > 2:
111+
ret = input(prompt)
112+
else:
113+
ret = raw_input(prompt)
111114
ret.rstrip(" \t")
112115
return ret
113116

@@ -336,22 +339,9 @@ def run(self, workpath, folder_for_extracting, remove_downloaded, force_update,
336339
print("==> Download (%s) finish!" % self._filename)
337340

338341

339-
def _check_python_version():
340-
major_ver = sys.version_info[0]
341-
if major_ver > 2:
342-
print ("The python version is %d.%d. But python 2.x is required. (Version 2.7 is well tested)\n"
343-
"Download it here: https://www.python.org/" % (major_ver, sys.version_info[1]))
344-
return False
345-
346-
return True
347-
348-
349342
def main():
350343
workpath = os.path.dirname(os.path.realpath(__file__))
351344

352-
if not _check_python_version():
353-
exit()
354-
355345
parser = OptionParser()
356346
parser.add_option('-r', '--remove-download',
357347
action="store", type="string", dest='remove_downloaded', default=None,

0 commit comments

Comments
 (0)