mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-03 20:34:43 +00:00
Merge pull request #277 from linkchecker/python3_23_alt
Fix test_console.py on Python 3
This commit is contained in:
commit
5179e47c52
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