From f4463198ac493b7380589f63a197153b041e71d5 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Mon, 24 Jan 2022 15:53:11 -0600 Subject: images: Make get_images_dir return absolute path __file__ isn't always an absolute path. It is sometimes when you import it via a module, but if you directly call it (e.g. via `python3 some_file.py`) then it seems like its a relative path. This avoids any uncertainty by forcing it to be an absolute path. --- images/populate_images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'images/populate_images.py') diff --git a/images/populate_images.py b/images/populate_images.py index f54ca8b9d..d49f02120 100755 --- a/images/populate_images.py +++ b/images/populate_images.py @@ -19,7 +19,7 @@ def get_images_dir(): Returns the absolute position of the images/ subdir in the UHD source tree. """ - return os.path.dirname(__file__) + return os.path.dirname(os.path.abspath(__file__)) def download_images(img_root_dir=None): " Go, go, go! " -- cgit v1.2.3