Skip to content

Commit 9263eea

Browse files
committed
Merge branch '3.x'
2 parents 36d6a66 + 1df14a4 commit 9263eea

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ Release 3.5.4 (in development)
140140
Dependencies
141141
------------
142142

143+
* #9071: Restrict docutils to 0.16
144+
143145
Incompatible changes
144146
--------------------
145147

@@ -152,7 +154,10 @@ Features added
152154
Bugs fixed
153155
----------
154156

157+
* #9078: autodoc: Async staticmethods and classmethods are considered as non
158+
async coroutine-functions with Python3.10
155159
* #8870: The style of toctree captions has been changed with docutils-0.17
160+
* #9001: The style of ``sidebar`` directive has been changed with docutils-0.17
156161

157162
Testing
158163
--------

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
'sphinxcontrib-qthelp',
2424
'Jinja2>=2.3',
2525
'Pygments>=2.0',
26-
'docutils>=0.14',
26+
'docutils>=0.14,<0.17',
2727
'snowballstemmer>=1.1',
2828
'babel>=1.3',
2929
'alabaster>=0.7,<0.8',

sphinx/themes/basic/static/basic.css_t

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ img.align-default, .figure.align-default {
319319

320320
/* -- sidebars -------------------------------------------------------------- */
321321

322-
div.sidebar {
322+
div.sidebar,
323+
aside.sidebar {
323324
margin: 0 0 0.5em 1em;
324325
border: 1px solid #ddb;
325326
padding: 7px;
@@ -377,12 +378,14 @@ div.body p.centered {
377378
/* -- content of sidebars/topics/admonitions -------------------------------- */
378379

379380
div.sidebar > :last-child,
381+
aside.sidebar > :last-child,
380382
div.topic > :last-child,
381383
div.admonition > :last-child {
382384
margin-bottom: 0;
383385
}
384386

385387
div.sidebar::after,
388+
aside.sidebar::after,
386389
div.topic::after,
387390
div.admonition::after,
388391
blockquote::after {

sphinx/util/inspect.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,18 @@ def isroutine(obj: Any) -> bool:
361361

362362
def iscoroutinefunction(obj: Any) -> bool:
363363
"""Check if the object is coroutine-function."""
364-
# unwrap staticmethod, classmethod and partial (except wrappers)
365-
obj = unwrap_all(obj, stop=lambda o: hasattr(o, '__wrapped__'))
364+
def iswrappedcoroutine(obj: Any) -> bool:
365+
"""Check if the object is wrapped coroutine-function."""
366+
if isstaticmethod(obj) or isclassmethod(obj) or ispartial(obj):
367+
# staticmethod, classmethod and partial method are not a wrapped coroutine-function
368+
# Note: Since 3.10, staticmethod and classmethod becomes a kind of wrappers
369+
return False
370+
elif hasattr(obj, '__wrapped__'):
371+
return True
372+
else:
373+
return False
374+
375+
obj = unwrap_all(obj, stop=iswrappedcoroutine)
366376
if hasattr(obj, '__code__') and inspect.iscoroutinefunction(obj):
367377
# check obj.__code__ because iscoroutinefunction() crashes for custom method-like
368378
# objects (see https://github.com/sphinx-doc/sphinx/issues/6605)

0 commit comments

Comments
 (0)