From 3c62b9340176dc409f3ad2802ae20779245d0f33 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Sat, 18 Sep 2021 07:18:23 +0100 Subject: [PATCH] Don't stringify variables that aren't suitable. Related to #38 though potentially not fixed. --- scone/head/dependency_tracking.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scone/head/dependency_tracking.py b/scone/head/dependency_tracking.py index 4a5a092..07435e1 100644 --- a/scone/head/dependency_tracking.py +++ b/scone/head/dependency_tracking.py @@ -215,7 +215,9 @@ class DependencyVarProxy: self._tracker.register_variable(self._current_path_prefix, raw_value) return str(raw_value) else: - return repr(self) + raise ValueError( + f"Trying to stringify a variable proxy which contains {repr(self)}" + ) def raw_(self) -> Union[Dict[str, Any], List[Any], int, str, bool]: if not self._current_path_prefix: