mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Report failure to parse files when running 2to3
This commit is contained in:
parent
f51e63718c
commit
7a4f44b6aa
@ -86,9 +86,11 @@ class To3(Command):
|
|||||||
oo, oe = sys.stdout, sys.stderr
|
oo, oe = sys.stdout, sys.stderr
|
||||||
sys.stdout = sys.stderr = buf = PolyglotStringIO()
|
sys.stdout = sys.stderr = buf = PolyglotStringIO()
|
||||||
try:
|
try:
|
||||||
run_2to3(f)
|
ret = run_2to3(f)
|
||||||
finally:
|
finally:
|
||||||
sys.stdout, sys.stderr = oo, oe
|
sys.stdout, sys.stderr = oo, oe
|
||||||
|
if ret:
|
||||||
|
raise SystemExit('Could not parse: ' + f)
|
||||||
output = buf.getvalue()
|
output = buf.getvalue()
|
||||||
return re.search(r'^RefactoringTool: No changes to ' + f, output, flags=re.M) is None
|
return re.search(r'^RefactoringTool: No changes to ' + f, output, flags=re.M) is None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user