From ff207e6703d1533441fb69464913066d68bfc141 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Mon, 30 Sep 2019 11:57:42 -0500 Subject: [PATCH] More robust python3 checking --- dev/release/download_rc_binaries.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/dev/release/download_rc_binaries.py b/dev/release/download_rc_binaries.py index e6136f3ede258..01ab2c468eaf6 100644 --- a/dev/release/download_rc_binaries.py +++ b/dev/release/download_rc_binaries.py @@ -17,19 +17,21 @@ # limitations under the License. # -import argparse -import concurrent.futures as cf -import functools -import hashlib -import json -import os -import subprocess import sys -import urllib.request - -if sys.version_info.major < 3: - raise Exception("Please use Python 3 to run this script") +try: + import argparse + import concurrent.futures as cf + import functools + import hashlib + import json + import os + import subprocess + import urllib.request +except ImportError: + if sys.version_info.major < 3: + raise Exception("Please use Python 3 to run this script") + raise BINTRAY_API_ROOT = "https://bintray.com/api/v1"