Check <sys.prefix>/local for data files
For some reason, even when sys.prefix is "/usr", some systems are installing
data files into "/usr/local"
Thomas Ross
3 years ago
49 | 49 | |
50 | 50 | def get_data_file_path(filename): |
51 | 51 | for prefix in ( |
52 | x for x in [sys.prefix, site.USER_BASE, getattr(sys, "base_prefix", None)] if x | |
52 | x | |
53 | for x in [ | |
54 | sys.prefix, | |
55 | os.path.join(sys.prefix, "local"), | |
56 | site.USER_BASE, | |
57 | getattr(sys, "base_prefix", None), | |
58 | ] | |
59 | if x | |
53 | 60 | ): |
54 | 61 | path = os.path.join(prefix, filename) |
55 | 62 | if os.path.exists(path): |