Skip to content
Merged

Gdot #45

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions sphinx_runpython/gdot/sphinx_gdot_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,28 @@ def run(self):
content = "\n".join(self.content)
if script or script == "":
stdout, stderr, _ = run_python_script(content, process=process)

if stderr:
out = [
"use_kernel_func_from_hub",
"is deprecated, use",
"was set in the config but",
"The axis name: batch will not be used",
]
if isinstance(stderr, str):
stderr = "\n".join(
[_ for _ in stderr.split("\n") if all(o not in _ for o in out)]
)
else:
bout = [_.encode("utf-8") for _ in out]
stderr = b"\n".join(
[
_
for _ in stderr.split(b"\n")
if all(o not in _ for o in bout)
]
)

if stderr:
logger = logging.getLogger("gdot")
logger.warning("[gdot] a dot graph cannot be draw due to %s", stderr)
Expand Down
2 changes: 0 additions & 2 deletions sphinx_runpython/runpython/sphinx_runpython_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,6 @@ def _filter_error(err):
return err
out = [
"use_kernel_func_from_hub",
"is deprecated, use",
"was set in the config but",
]
if isinstance(err, str):
res = "\n".join([_ for _ in err.split("\n") if all(o not in _ for o in out)])
Expand Down
Loading