From f31edb56ae3f44f7fadf6a0e6f813db7ebd5f3c0 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Wed, 20 Oct 2021 08:08:16 -0500 Subject: 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. --- images/create_imgs_package.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'images/create_imgs_package.py') 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...") -- cgit v1.2.3