Skip to content

Commit

Permalink
fix a bug of logging on terminals whose size is unknown
Browse files Browse the repository at this point in the history
reporeted by @yosupo06 at #609
  • Loading branch information
kmyk committed Nov 14, 2019
1 parent c189bae commit deb543d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onlinejudge/_implementation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def snip_large_file_content(content: bytes, limit: int, head: int, tail: int, bo
except UnicodeDecodeError as e:
return str(e)
font = log.bold if bold else (lambda s: s)
char_in_line, _ = shutil.get_terminal_size()
char_in_line, _ = shutil.get_terminal_size(fallback=(80, 24)) # fallback is required for Circle CI. see https://github.com/kmyk/online-judge-tools/issues/609

def snip_line_based():
lines = text.splitlines(keepends=True)
Expand Down

0 comments on commit deb543d

Please sign in to comment.