Skip to content

Commit

Permalink
moving module import inside of download function (apache#1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoreau89 authored and tqchen committed Jun 22, 2018
1 parent f4aa565 commit 2ef0528
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/tvm/contrib/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
import os
import sys
import time
import requests

if sys.version_info >= (3,):
import urllib.request as urllib2
else:
import urllib2

def download(url, path, overwrite=False, size_compare=False):
"""Downloads the file from the internet.
Expand All @@ -30,6 +24,13 @@ def download(url, path, overwrite=False, size_compare=False):
size_compare : bool, optional
Whether to do size compare to check downloaded file.
"""

import requests
if sys.version_info >= (3,):
import urllib.request as urllib2
else:
import urllib2

if os.path.isfile(path) and not overwrite:
if size_compare:
file_size = os.path.getsize(path)
Expand Down

0 comments on commit 2ef0528

Please sign in to comment.