mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-12 07:29:07 +08:00
close log file handle before move it.
This commit is contained in:
parent
cf46eaeac8
commit
99cb088708
@ -57,12 +57,13 @@ def setup_logging_logfile(logfile):
|
||||
)
|
||||
logfile.setFormatter(logfile_formatter)
|
||||
log.addHandler(logfile)
|
||||
return logfile
|
||||
|
||||
|
||||
def main():
|
||||
setup_logging_console()
|
||||
ctx = parse_flags()
|
||||
setup_logging_logfile(ctx.log_file)
|
||||
logfile = setup_logging_logfile(ctx.log_file)
|
||||
if not ctx.linedata:
|
||||
log.error("--linedata_only is required since only LSTM is supported")
|
||||
sys.exit(1)
|
||||
@ -78,6 +79,8 @@ def main():
|
||||
phase_E_extract_features(ctx, ["--psm", "6", "lstm.train"], "lstmf")
|
||||
make_lstmdata(ctx)
|
||||
|
||||
log.removeHandler(logfile)
|
||||
logfile.close()
|
||||
cleanup(ctx)
|
||||
log.info("All done!")
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user