Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/crawler/bin/import_sites.py

Issue 10942098: Make sure subprocess calls don`t ignore result codes indicating errors. Fix JS docs generation whil… (Closed)
Patch Set: Fixed wrong argument format Created July 4, 2013, 1:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/crawler/bin/import_sites.py
===================================================================
--- a/sitescripts/crawler/bin/import_sites.py
+++ b/sitescripts/crawler/bin/import_sites.py
@@ -29,17 +29,17 @@ def _get_db():
else:
return MySQLdb.connect(user=dbuser, passwd=dbpasswd, db=database,
use_unicode=True, charset="utf8")
def _get_cursor():
return _get_db().cursor(MySQLdb.cursors.DictCursor)
def _hg(args):
- return subprocess.Popen(["hg"] + args, stdout = subprocess.PIPE)
+ return subprocess.check_output(["hg"] + args)
def _extract_sites(easylist_dir):
os.chdir(easylist_dir)
process = _hg(["log", "--template", "{desc}\n"])
urls = set([])
for line in process.stdout:
match = re.search(r"\b(https?://\S*)", line)

Powered by Google App Engine
This is Rietveld