Skip to content

Commit f204ba1

Browse files
committed
Update to the environment_{file|loader} feature to fix compatibility with python 3.{4,5,6}
1 parent bf80f2b commit f204ba1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

supervisor/options.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1978,8 +1978,11 @@ def load_external_environment_definition_for_config(cls, config):
19781978
try:
19791979
from subprocess import check_output, CalledProcessError
19801980
kwargs = dict(shell=True)
1981-
if not PY2:
1982-
kwargs['text'] = True
1981+
if sys.version_info.major >= 3:
1982+
if sys.version_info.minor >= 7:
1983+
kwargs['text'] = True
1984+
else:
1985+
kwargs['encoding'] = 'utf8'
19831986

19841987
envdata = check_output(config.environment_loader, **kwargs)
19851988

0 commit comments

Comments
 (0)