提交 5a08cf3b 编写于 作者: K Konstantin Lopuhin

Fix test_start_requests_errors for PyPy

Twisted prints errors in DebugInfo.__del__, but PyPy does not run
gc.collect() on exit:
http://doc.pypy.org/en/latest/cpython_differences.html?highlight=gc.collect#differences-related-to-garbage-collection-strategies
上级 5aebdac4
......@@ -4,6 +4,7 @@ import optparse
import cProfile
import inspect
import pkg_resources
import gc
import scrapy
from scrapy.crawler import CrawlerProcess
......@@ -165,4 +166,9 @@ def _run_command_profiled(cmd, args, opts):
p.dump_stats(opts.profile)
if __name__ == '__main__':
execute()
try:
execute()
finally:
# Twisted prints errors in DebugInfo.__del__, but PyPy does not run gc.collect()
# on exit: http://doc.pypy.org/en/latest/cpython_differences.html?highlight=gc.collect#differences-related-to-garbage-collection-strategies
gc.collect()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册