aboutsummaryrefslogtreecommitdiffstats
path: root/images/create_imgs_package.py
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2021-10-20 08:08:16 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2021-10-20 12:44:36 -0700
commitf31edb56ae3f44f7fadf6a0e6f813db7ebd5f3c0 (patch)
tree7264f197f80e812e2573cae74bf0fddfb7080ac9 /images/create_imgs_package.py
parent5ee6b828debbd60e03aff805bfd80e2030715a6f (diff)
downloaduhd-f31edb56ae3f44f7fadf6a0e6f813db7ebd5f3c0.tar.gz
uhd-f31edb56ae3f44f7fadf6a0e6f813db7ebd5f3c0.tar.bz2
uhd-f31edb56ae3f44f7fadf6a0e6f813db7ebd5f3c0.zip
images: Update image packager script for Python 3
This commit makes minor changes to create_imgs_package.py to make it Python 3-compatible, harmonizing it with the rest of the Python scripts in UHD which have already been updated for Python 3.
Diffstat (limited to 'images/create_imgs_package.py')
-rwxr-xr-ximages/create_imgs_package.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/images/create_imgs_package.py b/images/create_imgs_package.py
index 50882287b..416242db1 100755
--- a/images/create_imgs_package.py
+++ b/images/create_imgs_package.py
@@ -19,7 +19,6 @@
Command-line utility to create a .zip-file with the current image set.
"""
-from __future__ import print_function
import re
import os
import subprocess
@@ -49,7 +48,7 @@ def get_version():
"""
try:
git_cmd = ['git', 'describe', '--abbrev=0', '--tags']
- git_output = subprocess.check_output(git_cmd)
+ git_output = subprocess.check_output(git_cmd).decode('UTF-8')
except subprocess.CalledProcessError as ex:
print(ex.output)
exit(1)
@@ -64,8 +63,8 @@ def main():
""" Go, go, go! """
args = parse_args()
img_root_dir = os.path.join(uhdimgs.get_images_dir(), 'images')
- print("== Clearing out the images directory...")
- shutil.rmtree(img_root_dir)
+ print("== Clearing out the images directory at {}, if present...".format(img_root_dir))
+ shutil.rmtree(img_root_dir, ignore_errors=True)
print("== Downloading images...")
download_images(img_root_dir)
print("== Determining version...")