diff --git a/supervisor/options.py b/supervisor/options.py index e05266429..75c61b5be 100644 --- a/supervisor/options.py +++ b/supervisor/options.py @@ -1978,7 +1978,7 @@ def load_external_environment_definition_for_config(cls, config): try: from subprocess import check_output, CalledProcessError kwargs = dict(shell=True) - if not PY2: + if sys.version_info.major >= 3 and sys.version_info.minor >= 7: kwargs['text'] = True envdata = check_output(config.environment_loader, **kwargs)