Skip to content

Commit

Permalink
Revert urlretrieve_with_retry() to support "filename" argument
Browse files Browse the repository at this point in the history
This allows urlretrieve_with_retry() to be called with or without filename. Mock tests can continue to pass filename and remain unchanged, since they do not create a temp file using NamedTemporaryFile. maybe_download() will work properly since it will use the temp file created within urlretrieve()
  • Loading branch information
chadkennedyonline authored Dec 2, 2016
1 parent d760c8a commit 90a60f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tensorflow/contrib/learn/python/learn/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def _is_retriable(e):


@retry(initial_delay=1.0, max_delay=16.0, is_retriable=_is_retriable)
def urlretrieve_with_retry(url):
return urllib.request.urlretrieve(url)
def urlretrieve_with_retry(url, filename=None):
return urllib.request.urlretrieve(url, filename)


def maybe_download(filename, work_directory, source_url):
Expand Down

0 comments on commit 90a60f2

Please sign in to comment.