File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -538,11 +538,10 @@ def visit_mypy_file(self, o: MypyFile) -> None:
538538 self .add ('# %s\n ' % name )
539539
540540 def visit_func_def (self , o : FuncDef , is_abstract : bool = False ) -> None :
541- if self .is_private_name (o .name (), o .fullname ()):
542- return
543- if self .is_not_in_all (o .name ()):
544- return
545- if self .is_recorded_name (o .name ()):
541+ if (self .is_private_name (o .name (), o .fullname ())
542+ or self .is_not_in_all (o .name ())
543+ or self .is_recorded_name (o .name ())):
544+ self .clear_decorators ()
546545 return
547546 if not self ._indent and self ._state not in (EMPTY , FUNC ) and not o .is_awaitable_coroutine :
548547 self .add ('\n ' )
Original file line number Diff line number Diff line change @@ -1262,6 +1262,24 @@ class F:
12621262@t.coroutine
12631263def g(): ...
12641264
1265+ [case testCoroutineSpecialCase_import]
1266+ import asyncio
1267+
1268+ __all__ = ['C']
1269+
1270+ @asyncio.coroutine
1271+ def f():
1272+ pass
1273+
1274+ class C:
1275+ def f(self):
1276+ pass
1277+ [out]
1278+ import asyncio
1279+
1280+ class C:
1281+ def f(self) -> None: ...
1282+
12651283-- Tests for stub generation from semantically analyzed trees.
12661284-- These tests are much slower, so use the `_semanal` suffix only when needed.
12671285
You can’t perform that action at this time.
0 commit comments