dist: strip some pointless code

This commit is contained in:
ed 2024-10-01 18:35:36 +00:00
parent 44f2b63e43
commit f1646b96ca
5 changed files with 26 additions and 3 deletions

View file

@ -61,11 +61,21 @@ def uh2(fp):
# remove expensive imports too
lns = []
on = True
on2 = True
for ln in cs.split("\n"):
if ln.startswith("if True:"):
on = False
continue
if ln.endswith("# !rm.yes>"):
on2 = False
continue
if not on2:
if ln.endswith("# !rm.no>"):
on2 = True
continue
if not on and (not ln.strip() or ln.startswith(" ")):
continue