From 0c4a81c9d3c55416138e37a47452967194270a63 Mon Sep 17 00:00:00 2001 From: Puqns67 Date: Sun, 20 Oct 2024 01:48:37 +0800 Subject: [PATCH] fix: remove redundant `.close()` On py313, pathlib.Path.glob() now returns a `map` object,which cannot be .close() File "/usr/lib/python3.13/site-packages/ncmlyrics/util.py", line 122, in testExistTrackSource globing.close() ^^^^^^^^^^^^^ AttributeError: 'map' object has no attribute 'close' --- ncmlyrics/util.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/ncmlyrics/util.py b/ncmlyrics/util.py index a2949c2..94de07c 100644 --- a/ncmlyrics/util.py +++ b/ncmlyrics/util.py @@ -118,8 +118,6 @@ def testExistTrackSource(track: NCMTrack, path: Path) -> Path | None: return next(globing) except StopIteration: return None - finally: - globing.close() def pickOutput(track: NCMTrack, outputs: list[Path], forceSourceExists: bool = False) -> Path | None: