import os
from typing import Callable, TypeVar
T = TypeVar("T")
def auto_chmod(func: Callable[..., T], arg: str) -> T:
if func == os.remove:
return func(arg)
raise
Regression introduced in #20492
Only shows up in real world code in #20602 , which looks something like this:
import os
from typing import Callable, TypeVar
T = TypeVar("T")
def auto_chmod(func: Callable[..., T], arg: str) -> T:
if func in [os.unlink, os.remove]:
return func(arg)
raise
Regression introduced in #20492
Only shows up in real world code in #20602 , which looks something like this: