Skip to content
Snippets Groups Projects
Commit a796dbfe authored by Simon Will's avatar Simon Will
Browse files

Print errors on stderr instead of stdout

parent 303aa71e
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
import logging
import re
import os.path
import sys
import traceback
from bs4 import BeautifulSoup
......@@ -122,7 +123,7 @@ def reconstruct_verse_text_from_reading(reading):
codepoints[token.span[0]:token.span[1]] = token.text
except Exception:
print('ERROR reconstructing verse from reading {!r}'
.format(reading))
.format(reading), file=sys.stderr)
traceback.print_exc()
codepoints = []
return ''.join(codepoints)
......
......@@ -4,6 +4,7 @@
import argparse
import json
import random
import sys
import traceback
from typing import List
......@@ -33,7 +34,8 @@ def dev(reference_verses, number=10, randomize=False) -> List[Verse]:
analysis = scanner.scan_verses([unidecode(ref.text)])[0]
except Exception:
errors += 1
print('ERROR at verse {}'.format(ref.text))
print('ERROR at verse {}'.format(ref.text),
file=sys.stderr)
traceback.print_exc()
continue
all_analyses.append(analysis)
......
......@@ -4,6 +4,7 @@
import argparse
import json
import os
import sys
import traceback
import allzweckmesser as azm
......@@ -27,7 +28,8 @@ def main(hypotactic_dir, top_out_dir, meters=['hexameter']):
'w') as f:
json.dump(verses_for_meter, f)
except Exception:
print('ERROR at document {}'.format(document.title))
print('ERROR at document {}'.format(document.title),
file=sys.stdderr)
traceback.print_exc()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment