Use posix.environ in Python client if available
This way there will be no need in converting keys and values to bytes objects on \*nix systems.
This commit is contained in:
parent
5434852977
commit
7871cfcda4
|
@ -5,8 +5,12 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
|
|||
|
||||
import sys
|
||||
import socket
|
||||
import os
|
||||
import errno
|
||||
import os
|
||||
try:
|
||||
from posix import environ
|
||||
except ImportError:
|
||||
from os import environ
|
||||
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
|
@ -69,7 +73,7 @@ else:
|
|||
args.append(cwd)
|
||||
|
||||
|
||||
args.extend((tobytes(k) + b'=' + tobytes(v) for k, v in os.environ.items()))
|
||||
args.extend((tobytes(k) + b'=' + tobytes(v) for k, v in environ.items()))
|
||||
|
||||
EOF = b'\0\0'
|
||||
|
||||
|
|
Loading…
Reference in New Issue