Commit 3f9c36daf12261d56399451cb6c7d6047424098c

Authored by hitier
1 parent 8b29751b
Exists in rhitier-dev and in 1 other branch DEV

Change urllib import

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
web/run.py 100755 → 100644
... ... @@ -8,7 +8,7 @@ import logging
8 8 import random
9 9 import tarfile
10 10 import time
11   -import urllib
  11 +import urllib.request as urllib_request
12 12 import requests
13 13 import re # regex
14 14 import numpy
... ... @@ -516,7 +516,7 @@ def retrieve_amda_netcdf(orbiter, what, started_at, stopped_at):
516 516 remote_gzip_files = []
517 517 while not success and retries < 3:
518 518 try:
519   - response = urllib.urlopen(url)
  519 + response = urllib_request.urlopen(url)
520 520 remote_gzip_files = json.loads(response.read())
521 521 if not remote_gzip_files:
522 522 raise Exception("Failed to fetch data at '%s'." % url)
... ... @@ -558,7 +558,7 @@ def retrieve_amda_netcdf(orbiter, what, started_at, stopped_at):
558 558 local_gzip_files.append(local_gzip_file)
559 559 if not isfile(local_gzip_file):
560 560 log.debug("Retrieving '%s'..." % local_gzip_file)
561   - urllib.urlretrieve(remote_gzip_file, local_gzip_file)
  561 + urllib_request.urlretrieve(remote_gzip_file, local_gzip_file)
562 562 log.debug("Retrieved '%s'." % local_gzip_file)
563 563 else:
564 564 log.debug("Found '%s' in the cache." % local_gzip_file)
... ...