Skip to content

Commit f922dfc

Browse files
author
Release Manager
committed
gh-39621: Fix documentation diff for cython() As discussed in #38946 (comment) , this hides an irrelevant entry in documentation diff. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #39621 Reported by: user202729 Reviewer(s): Travis Scrimshaw
2 parents be50a79 + 3c8eb0d commit f922dfc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/sage/misc/cython.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _webbrowser_open_file(path):
8888

8989
def cython(filename, verbose=0, compile_message=False,
9090
use_cache=False, create_local_c_file=False, annotate=True, view_annotate=False,
91-
view_annotate_callback=_webbrowser_open_file, sage_namespace=True, create_local_so_file=False):
91+
view_annotate_callback=None, sage_namespace=True, create_local_so_file=False):
9292
r"""
9393
Compile a Cython file. This converts a Cython file to a C (or C++ file),
9494
and then compiles that. The .c file and the .so file are
@@ -124,7 +124,8 @@ def cython(filename, verbose=0, compile_message=False,
124124
- ``view_annotate_callback`` -- function; a function that takes a string
125125
being the path to the html file. This can be overridden to change
126126
what to do with the annotated html file. Have no effect unless
127-
``view_annotate`` is ``True``.
127+
``view_annotate`` is ``True``. By default, the html file is opened in a
128+
web browser.
128129
129130
- ``sage_namespace`` -- boolean (default: ``True``); if ``True``, import
130131
``sage.all``
@@ -271,6 +272,9 @@ def cython(filename, verbose=0, compile_message=False,
271272
sage: len(collected_paths)
272273
1
273274
"""
275+
if view_annotate_callback is None:
276+
# needed because of https://github.com/sagemath/sage/pull/38946#issuecomment-2656329774
277+
view_annotate_callback = _webbrowser_open_file
274278
if not filename.endswith('pyx'):
275279
print("Warning: file (={}) should have extension .pyx".format(filename), file=sys.stderr)
276280

0 commit comments

Comments
 (0)