From 7c2b3df6170dcf8d8f36a1de9fcbc9dccdec81f8 Mon Sep 17 00:00:00 2001 From: spinerak Date: Sat, 25 May 2024 00:37:33 +0200 Subject: [PATCH] Testing if I change the generate.py --- .gitignore | 1 + Generate.py | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 44eb2b1fbd..e8464717b3 100644 --- a/.gitignore +++ b/.gitignore @@ -227,3 +227,4 @@ worlds/zillion/test/TestReproducibleRandom.py >>>>>>> parent of 10ea81dc (Update .gitignore) ======= >>>>>>> parent of fe196db0 (Removed zillion because it doesn't work) +Generate.py diff --git a/Generate.py b/Generate.py index 30b992317d..bd829d8370 100644 --- a/Generate.py +++ b/Generate.py @@ -558,19 +558,19 @@ def roll_alttp_settings(ret: argparse.Namespace, weights, plando_options): else: ret.sprite_pool += [key] * int(value) - -if __name__ == '__main__': - import atexit - confirmation = atexit.register(input, "Press enter to close.") - multiworld = main() - if __debug__: - import gc - import sys - import weakref - weak = weakref.ref(multiworld) - del multiworld - gc.collect() # need to collect to deref all hard references - assert not weak(), f"MultiWorld object was not de-allocated, it's referenced {sys.getrefcount(weak())} times." \ - " This would be a memory leak." - # in case of error-free exit should not need confirmation - atexit.unregister(confirmation) +for i in range(100): + if __name__ == '__main__': + import atexit + confirmation = atexit.register(input, "Press enter to close.") + multiworld = main() + if __debug__: + import gc + import sys + import weakref + weak = weakref.ref(multiworld) + del multiworld + gc.collect() # need to collect to deref all hard references + assert not weak(), f"MultiWorld object was not de-allocated, it's referenced {sys.getrefcount(weak())} times." \ + " This would be a memory leak." + # in case of error-free exit should not need confirmation + atexit.unregister(confirmation)