From b517ec72b7c6939681de5c96e4321c4754f99b9c Mon Sep 17 00:00:00 2001 From: Yu-Han Liu Date: Mon, 18 Mar 2019 17:54:47 -0700 Subject: [PATCH 1/2] fix urllib2 import --- video/cloud-client/analyze/beta_snippets_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/cloud-client/analyze/beta_snippets_test.py b/video/cloud-client/analyze/beta_snippets_test.py index b6b61cdb81c..3996a340579 100644 --- a/video/cloud-client/analyze/beta_snippets_test.py +++ b/video/cloud-client/analyze/beta_snippets_test.py @@ -15,7 +15,7 @@ # limitations under the License. import time -import urllib2 +from urllib.request import urlopen import uuid import beta_snippets @@ -29,7 +29,7 @@ @pytest.fixture(scope='session') def video_path(tmpdir_factory): - file = urllib2.urlopen( + file = urlopen( 'http://storage.googleapis.com/cloud-samples-data/video/cat.mp4') path = tmpdir_factory.mktemp('video').join('file.mp4') with open(str(path), 'wb') as f: From 810b4c63466d8404c9de8ebd146a13ba6c67d16b Mon Sep 17 00:00:00 2001 From: Yu-Han Liu Date: Mon, 18 Mar 2019 17:58:37 -0700 Subject: [PATCH 2/2] use six --- video/cloud-client/analyze/beta_snippets_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/cloud-client/analyze/beta_snippets_test.py b/video/cloud-client/analyze/beta_snippets_test.py index 3996a340579..7402b014c95 100644 --- a/video/cloud-client/analyze/beta_snippets_test.py +++ b/video/cloud-client/analyze/beta_snippets_test.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +from six.moves.urllib.request import urlopen import time -from urllib.request import urlopen import uuid import beta_snippets