Skip to content

Commit

Permalink
Merge pull request #611 from kmyk/issue/609
Browse files Browse the repository at this point in the history
fix a bug of logging on terminals whose size is unknown
  • Loading branch information
fukatani authored Nov 14, 2019
2 parents bf68f61 + e61f93d commit 89444e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions onlinejudge/_implementation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ def snip_large_file_content(content: bytes, limit: int, head: int, tail: int, bo
return str(e)
font = log.bold if bold else (lambda s: s)
char_in_line, _ = shutil.get_terminal_size()
char_in_line = max(char_in_line, 40) # shutil.get_terminal_size() may return too small values (e.g. (0, 0) on Circle CI) successfully (i.e. fallback is not used). see https://github.com/kmyk/online-judge-tools/pull/611

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

0 comments on commit 89444e7

Please sign in to comment.