Unnecessary delete statement in a local scope PTC-W0043
Anti-pattern
Major
19 days ago2 years old
Unnecessary del statement in a local scope
1881                    loc = None
1882                    with suppress(KeyError):
1883                        tmpl, loc = moved_links[page.site.code]
1884                        del tmpl1885                    if loc is not None and loc in page.title():
1886                        pywikibot.info(
1887                            f'Skipping: {page.title()} is a templates subpage')
Unnecessary del statement in a local scope
 525        elif arg == 'ignorefile':
 526            ignore_page_gen = pagegenerators.TextIOPageGenerator(value)
 527            self.ignore.update(ignore_page_gen)
 528            del ignore_page_gen 529        elif arg == 'showpage':
 530            self.showtextlink += self.showtextlinkadd
 531        elif arg == 'graph':
Unnecessary del statement in a local scope
 516        elif arg == 'skipfile':
 517            skip_page_gen = pagegenerators.TextIOPageGenerator(value)
 518            self.skip.update(skip_page_gen)
 519            del skip_page_gen 520        elif arg == 'neverlink':
 521            self.neverlink += value.split(',')
 522        elif arg == 'ignore':
Unnecessary del statement in a local scope
 811        start = m.start()
 812        # Since this point the m variable shouldn't be used as it may not
 813        # contain all contents
 814        del m 815
 816        try:
 817            link = pywikibot.Link.create_separated(
Unnecessary del statement in a local scope
 846                page = pywikibot.Page(self.site, 'Pywikibot nobots test')
 847                page.text = content
 848                self.assertFalse(page.botMayEdit())
 849                del page 850
 851
 852class TestPageHistory(DefaultSiteTestCase):