Browse files

Fix the dispatch test GC code under PyPy, and make the comment for Jy…

…thon better.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent b9910bd commit 1aaa0dd09865980743f940bc16ea1982aee49866 @alex alex committed Jan 1, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 tests/regressiontests/dispatch/tests/
@@ -8,9 +8,16 @@
if sys.platform.startswith('java'):
def garbage_collect():
- """Run the garbage collector and wait a bit to let it do his work"""
+ # Some JVM GCs will execute finalizers in a different thread, meaning
+ # we need to wait for that to complete before we go on looking for the
+ # effects of that.
+elif hasattr(sys, "pypy_version_info"):
+ def garbage_collect():
+ # Collecting weakreferences can take two collections on PyPy.
+ gc.collect()
+ gc.collect()
def garbage_collect():

0 comments on commit 1aaa0dd

Please sign in to comment.