diff options
author | Lane Kolbly <lane.kolbly@ni.com> | 2022-01-24 15:53:11 -0600 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-01-25 13:02:15 -0600 |
commit | f4463198ac493b7380589f63a197153b041e71d5 (patch) | |
tree | 8f57a48f6900d3c3bf55f7b5e64106e004be4b3d /images/populate_images.py | |
parent | 98a13add8171d20215a738d19d48925babf22689 (diff) | |
download | uhd-f4463198ac493b7380589f63a197153b041e71d5.tar.gz uhd-f4463198ac493b7380589f63a197153b041e71d5.tar.bz2 uhd-f4463198ac493b7380589f63a197153b041e71d5.zip |
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.
Diffstat (limited to 'images/populate_images.py')
-rwxr-xr-x | images/populate_images.py | 2 |
1 files changed, 1 insertions, 1 deletions
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! " |