From c881ced7107b2113923cecc65ace35b907d48756 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Tue, 22 Sep 2026 17:29:25 -0400 Subject: [PATCH] add test to ensure iterSourceCode does not process dead links --- pyflakes/test/test_api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py index 518a49fe..92a7240e 100644 --- a/pyflakes/test/test_api.py +++ b/pyflakes/test/test_api.py @@ -218,6 +218,11 @@ def test_explicitFiles(self): self.assertEqual(list(iterSourceCode([epath])), [epath]) + def test_skips_dead_symlink(self): + os.symlink('dead', os.path.join(self.tempdir, 'symlink')) + tpath = self.makeEmptyFile('t.py') + self.assertEqual(list(iterSourceCode([self.tempdir])), [tpath]) + class TestReporter(TestCase): """