Skip to content

Commit 9cb14b4

Browse files
authored
Merge pull request #380 from jhamman/fix/yaml_dict
compare yaml dict to mapping, not dict
2 parents 5894512 + 6f60f63 commit 9cb14b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

repo2docker/buildpacks/conda/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""BuildPack for conda environments"""
22
import os
33
import re
4+
from collections import Mapping
45

56
from ruamel.yaml import YAML
67

@@ -139,8 +140,8 @@ def python_version(self):
139140
# check if the env file is empty, if so instantiate an empty dictionary.
140141
if env is None:
141142
env = {}
142-
# check if the env file has a dictionary not a list or other data structure.
143-
if not isinstance(env, dict):
143+
# check if the env file provided a dick-like thing not a list or other data structure.
144+
if not isinstance(env, Mapping):
144145
raise TypeError("environment.yml should contain a dictionary. Got %r" % type(env))
145146
for dep in env.get('dependencies', []):
146147
if not isinstance(dep, str):

0 commit comments

Comments
 (0)