add error_context() to groups.py and nodes.py

This commit is contained in:
Franzi 2022-02-07 06:57:58 +01:00
parent bc4f6e507a
commit 39e9ececa2
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,10 @@
from os.path import join from os.path import join
from pathlib import Path from pathlib import Path
from bundlewrap.utils import error_context
groups = {} groups = {}
for group in Path(join(repo_path, "groups")).rglob("*.py"): for group in Path(join(repo_path, "groups")).rglob("*.py"):
with error_context(filename=str(group)):
with open(group, 'r') as f: with open(group, 'r') as f:
exec(f.read()) exec(f.read())

View file

@ -4,8 +4,10 @@ from pathlib import Path
import bwpass import bwpass
from bundlewrap.metadata import atomic from bundlewrap.metadata import atomic
from bundlewrap.utils import error_context
for node in Path(join(repo_path, "nodes")).rglob("*.py"): for node in Path(join(repo_path, "nodes")).rglob("*.py"):
with error_context(filename=str(node)):
with open(node, 'r') as f: with open(node, 'r') as f:
exec(f.read()) exec(f.read())