mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-24 08:04:44 +00:00
Fix test_console.py on Python 3
This is a alternative fix I suggested in the comments on PR #273.
This commit is contained in:
parent
4e6c806bff
commit
60f9f80b9f
1 changed files with 3 additions and 1 deletions
|
|
@ -202,4 +202,6 @@ def get_encoded_writer (out=sys.stdout, encoding=None, errors='replace'):
|
|||
if encoding is None:
|
||||
encoding = default_encoding
|
||||
Writer = codecs.getwriter(encoding)
|
||||
return Writer(out, errors)
|
||||
# Use sys.stdout.buffer on Python 3, but sys.stdout itself on Python 2
|
||||
buffer = getattr(out, 'buffer', out)
|
||||
return Writer(buffer, errors)
|
||||
|
|
|
|||
Loading…
Reference in a new issue