Revert "Testing if I change the generate.py"

This reverts commit 7c2b3df617.
This commit is contained in:
spinerak
2024-05-25 00:38:02 +02:00
parent 7c2b3df617
commit d39f6650af
2 changed files with 16 additions and 17 deletions

1
.gitignore vendored
View File

@@ -227,4 +227,3 @@ worlds/zillion/test/TestReproducibleRandom.py
>>>>>>> parent of 10ea81dc (Update .gitignore)
=======
>>>>>>> parent of fe196db0 (Removed zillion because it doesn't work)
Generate.py

View File

@@ -558,19 +558,19 @@ def roll_alttp_settings(ret: argparse.Namespace, weights, plando_options):
else:
ret.sprite_pool += [key] * int(value)
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)
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)