File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1245,7 +1245,7 @@ def check_func_def(
1245
1245
# have no good way of doing this.
1246
1246
#
1247
1247
# TODO: Find a way of working around this limitation
1248
- if _is_empty_generator (item ) or len (expanded ) >= 2 :
1248
+ if _is_empty_generator_function (item ) or len (expanded ) >= 2 :
1249
1249
self .binder .suppress_unreachable_warnings ()
1250
1250
self .accept (item .body )
1251
1251
unreachable = self .binder .is_unreachable ()
@@ -6966,7 +6966,7 @@ def is_literal_not_implemented(n: Expression) -> bool:
6966
6966
return isinstance (n , NameExpr ) and n .fullname == "builtins.NotImplemented"
6967
6967
6968
6968
6969
- def _is_empty_generator (func : FuncItem ) -> bool :
6969
+ def _is_empty_generator_function (func : FuncItem ) -> bool :
6970
6970
"""
6971
6971
Checks whether a function's body is 'return; yield' (the yield being added only
6972
6972
to promote the function into a generator).
Original file line number Diff line number Diff line change @@ -1447,15 +1447,15 @@ def f() -> None:
1447
1447
x = 0 # This should not be reported as unreachable
1448
1448
[builtins fixtures/exception.pyi]
1449
1449
1450
- [case testIntentionallyEmptyGenerator ]
1450
+ [case testIntentionallyEmptyGeneratorFunction ]
1451
1451
# flags: --warn-unreachable
1452
1452
from typing import Generator
1453
1453
1454
1454
def f() -> Generator[None, None, None]:
1455
1455
return
1456
1456
yield
1457
1457
1458
- [case testIntentionallyEmptyGenerator_None ]
1458
+ [case testIntentionallyEmptyGeneratorFunction_None ]
1459
1459
# flags: --warn-unreachable
1460
1460
from typing import Generator
1461
1461
You can’t perform that action at this time.
0 commit comments