Merge pull request #380 from jhamman/fix/yaml_dict

compare yaml dict to mapping, not dict
pull/385/head
Min RK 2018-08-20 15:59:30 +02:00 zatwierdzone przez GitHub
commit 9cb14b414b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -1,6 +1,7 @@
"""BuildPack for conda environments"""
import os
import re
from collections import Mapping
from ruamel.yaml import YAML
@ -139,8 +140,8 @@ class CondaBuildPack(BaseImage):
# check if the env file is empty, if so instantiate an empty dictionary.
if env is None:
env = {}
# check if the env file has a dictionary not a list or other data structure.
if not isinstance(env, dict):
# check if the env file provided a dick-like thing not a list or other data structure.
if not isinstance(env, Mapping):
raise TypeError("environment.yml should contain a dictionary. Got %r" % type(env))
for dep in env.get('dependencies', []):
if not isinstance(dep, str):