Skip to content

Commit 9b3ee2c

Browse files
committed
Move licenses out of resource system
1 parent a6a3605 commit 9b3ee2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

addonmanager_licenses.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def __init__(self):
4040
self._load_license_data()
4141

4242
def _load_license_data(self):
43-
spdx_path = ":/licenses/spdx.json"
43+
if not __file__:
44+
raise RuntimeError(
45+
"The SPDXLicenseManager must be run in an environment where __file__ is known"
46+
)
47+
spdx_path = f"{os.path.dirname(__file__)}/Resources/licenses/spdx.json"
4448
if os.path.exists(spdx_path):
4549
with open(spdx_path, "r", encoding="utf-8") as f:
4650
string_data = f.read()

0 commit comments

Comments
 (0)