Skip to content

Commit

Permalink
Update to the environment_{file|loader} feature to fix compatibility …
Browse files Browse the repository at this point in the history
…with python 3.{4,5,6}
  • Loading branch information
wynnw committed Apr 30, 2021
1 parent bf80f2b commit f204ba1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions supervisor/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1978,8 +1978,11 @@ def load_external_environment_definition_for_config(cls, config):
try:
from subprocess import check_output, CalledProcessError
kwargs = dict(shell=True)
if not PY2:
kwargs['text'] = True
if sys.version_info.major >= 3:
if sys.version_info.minor >= 7:
kwargs['text'] = True
else:
kwargs['encoding'] = 'utf8'

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

Expand Down

0 comments on commit f204ba1

Please sign in to comment.