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
|
||||
sys.stdout = sys.stderr = buf = PolyglotStringIO()
|
||||
try:
|
||||
run_2to3(f)
|
||||
ret = run_2to3(f)
|
||||
finally:
|
||||
sys.stdout, sys.stderr = oo, oe
|
||||
if ret:
|
||||
raise SystemExit('Could not parse: ' + f)
|
||||
output = buf.getvalue()
|
||||
return re.search(r'^RefactoringTool: No changes to ' + f, output, flags=re.M) is None
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user