State the guard as the invariant it holds and keep entry for transcript lines
This commit is contained in:
+1
-1
@@ -416,7 +416,7 @@ def trust(paths):
|
||||
print(f"could not read {config}: {getattr(failure, 'strerror', failure)}", file=sys.stderr)
|
||||
return
|
||||
projects = data.setdefault("projects", {}) if isinstance(data, dict) else None
|
||||
if not isinstance(projects, dict) or any(not isinstance(entry, dict) for entry in projects.values()):
|
||||
if not isinstance(projects, dict) or not all(isinstance(record, dict) for record in projects.values()):
|
||||
print(f"could not read {config}: not an object whose projects maps paths to objects", file=sys.stderr)
|
||||
return
|
||||
granted = [path for path in paths if not projects.get(path, {}).get("hasTrustDialogAccepted")]
|
||||
|
||||
Reference in New Issue
Block a user