Skip to content

Commit dbf61f0

Browse files
No public description
PiperOrigin-RevId: 875793109
1 parent 235efa3 commit dbf61f0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

google/colab/_inspector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
582582
if filename and (
583583
filename.endswith(('.py', '.py3', '.pyc'))
584584
or 'ipython-input-' in filename
585+
or 'ipykernel_' in filename
585586
):
586587
out['file'] = filename
587588

google/colab/_reprs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ def _function_repr(obj):
286286
)
287287

288288
result += html.escape(docs) + '</pre>'
289-
if filename and 'ipython-input' not in filename:
289+
jupyter_paths = ('ipython-input', 'ipykernel_')
290+
if filename and all(path not in filename for path in jupyter_paths):
290291
line = oinspect.find_source_lines(obj)
291292
result += f"""
292293
<script>

0 commit comments

Comments
 (0)