On Tue, 12 Aug 2025 13:12:47 +0200 Paolo Abeni wrote:
> On 8/9/25 12:57 AM, Jakub Kicinski wrote:
> > @@ -48,6 +51,19 @@ from .remote import Remote
> >                  env[pair[0]] = pair[1]
> >          return ksft_setup(env)
> >  
> > +    def __enter__(self):
> > +        ip(f"link set dev {self.dev['ifname']} up")
> > +        wait_file(f"/sys/class/net/{self.dev['ifname']}/carrier",
> > +                  lambda x: x.strip() == "1")
> > +
> > +        return self
> > +
> > +    def __exit__(self, ex_type, ex_value, ex_tb):
> > +        """
> > +        __exit__ gets called at the end of a "with" block.
> > +        """
> > +        self.__del__()
> > +  
> 
> pylint is doing what looks like a reasonable complain to me:
> 
> tools/testing/selftests/drivers/net/lib/py/env.py:65:8: E1101: Instance
> of 'NetDrvEnvBase' has no '__del__' member (no-member)

I know, it's an abstract class. The point of having an empty method is
lost on me. But okay, let me obey the static analyzer overlord.

Reply via email to