mirror of https://github.com/scrapy/scrapy.git
get_spider_list_from_eggfile(): fail if unable to extract spider list
This commit is contained in:
parent
369a149d60
commit
7ba972d8cf
|
|
@ -18,8 +18,11 @@ def get_spider_list_from_eggfile(eggfile, project):
|
|||
env = os.environ.copy()
|
||||
env['SCRAPY_PROJECT'] = project
|
||||
env['SCRAPY_EGGFILE'] = f.name
|
||||
proc = Popen(pargs, stdout=PIPE, cwd=tmpdir, env=env)
|
||||
out = proc.communicate()[0]
|
||||
proc = Popen(pargs, stdout=PIPE, stderr=PIPE, cwd=tmpdir, env=env)
|
||||
out, err = proc.communicate()
|
||||
if proc.returncode:
|
||||
msg = err.splitlines()[-1] if err else "unknown error"
|
||||
raise RuntimeError(msg)
|
||||
return out.splitlines()
|
||||
finally:
|
||||
shutil.rmtree(tmpdir)
|
||||
|
|
|
|||
Loading…
Reference in New Issue