From 94727df4dbfa1e03c09e89cb87c2433232318962 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Fri, 1 Oct 2021 11:35:21 -0700 Subject: [PATCH] trac 30778: patch sageinspect to not print warning when skipfile returns True. --- src/sage/misc/sageinspect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py index b9691bbb628..44805bc0b5a 100644 --- a/src/sage/misc/sageinspect.py +++ b/src/sage/misc/sageinspect.py @@ -2062,10 +2062,10 @@ def sage_getdoc(obj, obj_name='', embedded=False): r = sage_getdoc_original(obj) s = sage.misc.sagedoc.format(r, embedded=embedded) f = sage_getfile(obj) - if f: + if f and os.path.exists(f): from sage.doctest.control import skipfile skip = skipfile(f) - if skip: + if isinstance(skip, str): warn = """WARNING: the enclosing module is marked '{}', so doctests may not pass.""".format(skip) s = warn + "\n\n" + s