Skip to content

Commit 52fd229

Browse files
committed
Merge branch '4.1.x' into 4.x
2 parents ebb03cd + 4dc45f0 commit 52fd229

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Bugs fixed
5050
with the HEAD of 3.10
5151
* #9490: autodoc: Some objects under ``typing`` module are not displayed well
5252
with the HEAD of 3.10
53+
* #9436, #9471: autodoc: crashed if ``autodoc_class_signature = "separated"``
54+
* #9456: html search: html_copy_source can't control the search summaries
5355
* #9435: linkcheck: Failed to check anchors in github.com
5456

5557
Testing

sphinx/ext/autodoc/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ def process(app: Sphinx, what_: str, name: str, obj: Any, options: Any, lines: L
257257
# But we define this class here to keep compatibility (see #4538)
258258
class Options(dict):
259259
"""A dict/attribute hybrid that returns None on nonexisting keys."""
260+
def copy(self) -> "Options":
261+
return Options(super().copy())
262+
260263
def __getattr__(self, name: str) -> Any:
261264
try:
262265
return self[name.replace('_', '-')]
@@ -1445,9 +1448,11 @@ def __init__(self, *args: Any) -> None:
14451448
super().__init__(*args)
14461449

14471450
if self.config.autodoc_class_signature == 'separated':
1451+
self.options = self.options.copy()
1452+
14481453
# show __init__() method
14491454
if self.options.special_members is None:
1450-
self.options['special-members'] = {'__new__', '__init__'}
1455+
self.options['special-members'] = ['__new__', '__init__']
14511456
else:
14521457
self.options.special_members.append('__new__')
14531458
self.options.special_members.append('__init__')

sphinx/themes/basic/static/searchtools.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ var Search = {
276276
setTimeout(function() {
277277
displayNextItem();
278278
}, 5);
279-
} else {
279+
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
280280
$.ajax({url: requestUrl,
281281
dataType: "text",
282282
complete: function(jqxhr, textstatus) {
@@ -289,6 +289,12 @@ var Search = {
289289
displayNextItem();
290290
}, 5);
291291
}});
292+
} else {
293+
// no source available, just display title
294+
Search.output.append(listItem);
295+
setTimeout(function() {
296+
displayNextItem();
297+
}, 5);
292298
}
293299
}
294300
// search finished, update title and status message

0 commit comments

Comments
 (0)