summaryrefslogtreecommitdiff
path: root/scripts/download_import_cldr.py
diff options
context:
space:
mode:
authorAlex Morega <alex@grep.ro>2013-07-07 13:12:11 +0200
committerAlex Morega <alex@grep.ro>2013-07-07 13:12:11 +0200
commitba869e9a67d4604aa7be097411ab30bcb17437bd (patch)
tree51c6a4fba1110020b2f2dba002e3964496527d47 /scripts/download_import_cldr.py
parent81ed308d5afe7d7885173d56a3d97a9589400234 (diff)
downloadbabel-ba869e9a67d4604aa7be097411ab30bcb17437bd.tar.gz
fix cldr download script for py3
Diffstat (limited to 'scripts/download_import_cldr.py')
-rwxr-xr-xscripts/download_import_cldr.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/download_import_cldr.py b/scripts/download_import_cldr.py
index b60a0e4..68e6434 100755
--- a/scripts/download_import_cldr.py
+++ b/scripts/download_import_cldr.py
@@ -7,6 +7,10 @@ import hashlib
import zipfile
import urllib
import subprocess
+try:
+ from urllib.request import urlretrieve
+except ImportError:
+ from urllib import urlretrieve
URL = 'http://unicode.org/Public/cldr/23/core.zip'
@@ -42,7 +46,7 @@ def reporthook(block_count, block_size, total_size):
def log(message, *args):
if args:
message = message % args
- print >> sys.stderr, message
+ sys.stderr.write(message + '\n')
def is_good_file(filename):
@@ -70,7 +74,7 @@ def main():
log('Downloading \'%s\'', FILENAME)
if os.path.isfile(zip_path):
os.remove(zip_path)
- urllib.urlretrieve(URL, zip_path, reporthook)
+ urlretrieve(URL, zip_path, reporthook)
changed = True
print
common_path = os.path.join(cldr_path, 'common')