From 3ff483c09a5073ae79f67df8faede88e70465bfc Mon Sep 17 00:00:00 2001 From: Alwin Schuster Date: Tue, 8 Mar 2022 20:02:51 +0100 Subject: [PATCH] Fix global variable bug --- graphviz_py/parser.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphviz_py/parser.py b/graphviz_py/parser.py index 4a9b119..1e037a5 100644 --- a/graphviz_py/parser.py +++ b/graphviz_py/parser.py @@ -50,7 +50,7 @@ def convert(python_graphviz: str, arguments: List[str]) -> str: output = str(output) else: - exec(py_code) + exec(py_code, globals()) output = "" except Exception as ex: raise Exception(f"Error while processing: {expression}", ex) diff --git a/pyproject.toml b/pyproject.toml index 0596c83..89d8e13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "graphviz-py" -version = "1.0.6" +version = "1.0.7" description = "Allows Python code execution inside of graphviz diagrams." authors = ["Alwin Schuster "] license = 'MPL-2.0'