Skip to content

Commit b8594e9

Browse files
sdpythonxadupre
andauthored
Gdot (#45)
* fix url * spell * fix * last --------- Co-authored-by: Xavier Dupré <xadupre@microsoft.com>
1 parent 163e255 commit b8594e9

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

sphinx_runpython/gdot/sphinx_gdot_extension.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,28 @@ def run(self):
148148
content = "\n".join(self.content)
149149
if script or script == "":
150150
stdout, stderr, _ = run_python_script(content, process=process)
151+
152+
if stderr:
153+
out = [
154+
"use_kernel_func_from_hub",
155+
"is deprecated, use",
156+
"was set in the config but",
157+
"The axis name: batch will not be used",
158+
]
159+
if isinstance(stderr, str):
160+
stderr = "\n".join(
161+
[_ for _ in stderr.split("\n") if all(o not in _ for o in out)]
162+
)
163+
else:
164+
bout = [_.encode("utf-8") for _ in out]
165+
stderr = b"\n".join(
166+
[
167+
_
168+
for _ in stderr.split(b"\n")
169+
if all(o not in _ for o in bout)
170+
]
171+
)
172+
151173
if stderr:
152174
logger = logging.getLogger("gdot")
153175
logger.warning("[gdot] a dot graph cannot be draw due to %s", stderr)

sphinx_runpython/runpython/sphinx_runpython_extension.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,6 @@ def _filter_error(err):
470470
return err
471471
out = [
472472
"use_kernel_func_from_hub",
473-
"is deprecated, use",
474-
"was set in the config but",
475473
]
476474
if isinstance(err, str):
477475
res = "\n".join([_ for _ in err.split("\n") if all(o not in _ for o in out)])

0 commit comments

Comments
 (0)