# If we have a local archive file with the test data, extract it.
directory_name = "data"
+ directory_name_old = "data.old"
if os.path.exists(directory_name):
- os.rename(directory_name, "data.old")
+ if os.path.exists(directory_name_old):
+ shutil.rmtree(directory_name_old)
+ os.rename(directory_name, directory_name_old)
archive_file = "downloaded_%s.tar.gz" % MOZILLA_VERSION
if os.path.exists(archive_file):
with tarfile.open(archive_file, "r:gz") as tar:
import hashlib
import os
+import shutil
import sys
import tarfile
import urllib
print "Downloading test data from %s ..." % archive_url
urllib.urlretrieve(archive_url, archive_name)
if os.path.exists(directory_name):
+ if os.path.exists(directory_old_name):
+ shutil.rmtree(directory_old_name)
os.rename(directory_name, directory_old_name)
if not os.path.exists(directory_name):
print "Extracting test262-%s.tar.bz2 ..." % revision