From 1e2efe566445bef93f74aae710a5d621da9796de Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Fri, 7 Sep 2012 15:40:26 -0300 Subject: [PATCH] scrapy deploy: retry setup.py bdist_egg on EINTR. closes #9 --- scrapy/commands/deploy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scrapy/commands/deploy.py b/scrapy/commands/deploy.py index ce9cb3f42..082c46455 100644 --- a/scrapy/commands/deploy.py +++ b/scrapy/commands/deploy.py @@ -15,6 +15,7 @@ from w3lib.form import encode_multipart from scrapy.command import ScrapyCommand from scrapy.exceptions import UsageError from scrapy.utils.http import basic_auth_header +from scrapy.utils.python import retry_on_eintr from scrapy.utils.conf import get_config, closest_scrapy_cfg _SETUP_PY_TEMPLATE = \ @@ -206,7 +207,7 @@ def _build_egg(): _create_default_setup_py(settings=settings) d = tempfile.mkdtemp() f = tempfile.TemporaryFile(dir=d) - check_call([sys.executable, 'setup.py', 'clean', '-a', 'bdist_egg', '-d', d], stdout=f) + retry_on_eintr(check_call, [sys.executable, 'setup.py', 'clean', '-a', 'bdist_egg', '-d', d], stdout=f) egg = glob.glob(os.path.join(d, '*.egg'))[0] return egg, d