test(seedvr2): helper extraction stops at the next top-level def, decorator or comment

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Jason Hoku
2026-11-04 00:48:02 -08:00
co-authored by Claude Fable 5.1
parent 536d691a6b
commit 2b70bb1da3
+1 -1
View File
@@ -15,7 +15,7 @@ sys.path.insert(0, _ROOT)
def _load_helper():
src = open(os.path.join(_ROOT, "image_generation.py"), encoding="utf-8").read()
m = re.search(r"^def pil_to_image_array\(.*?(?=^def )", src, re.S | re.M)
m = re.search(r"^def pil_to_image_array\(.*?(?=^(?:def |@|#))", src, re.S | re.M) # stop at the next top-level def/decorator/comment
ns = {}
exec(m.group(0), ns)
return ns["pil_to_image_array"]