mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Move the encoding down into the Python 3 block
This commit is contained in:
parent
492c17bf30
commit
209a7ff5f6
1 changed files with 2 additions and 4 deletions
|
@ -9,12 +9,10 @@ import imp
|
|||
import sys
|
||||
import site
|
||||
|
||||
|
||||
uses_pycache = hasattr(imp, 'cache_from_source')
|
||||
|
||||
|
||||
console_encoding = sys.__stdout__.encoding
|
||||
|
||||
|
||||
try:
|
||||
from logging.config import dictConfig as logging_dictConfig
|
||||
except ImportError:
|
||||
|
@ -24,7 +22,7 @@ except ImportError:
|
|||
if sys.version_info >= (3,):
|
||||
def console_to_str(s):
|
||||
try:
|
||||
return s.decode(console_encoding)
|
||||
return s.decode(sys.__stdout__.encoding)
|
||||
except UnicodeDecodeError:
|
||||
return s.decode('utf_8')
|
||||
|
||||
|
|
Loading…
Reference in a new issue