Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_env param does not work with dict-like objects #527

Closed
saytosid opened this issue May 4, 2020 · 1 comment · Fixed by #530
Closed

_env param does not work with dict-like objects #527

saytosid opened this issue May 4, 2020 · 1 comment · Fixed by #530
Labels

Comments

@saytosid
Copy link

saytosid commented May 4, 2020

sh/sh.py

Lines 1149 to 1151 in 114e6ee

if not isinstance(env, dict):
invalid.append(("env", "env must be a dict. Got {!r}".format(env)))
return invalid

wrt the above snippet, is it necessary to enforce dict? This breaks compatibility with other dict-like objects. eg: os.environ returns a dict-like object os._Environ.

Perhaps a check for isinstance(env, collections.Mapping) would allow for more general interface?

@ecederstrand
Copy link
Collaborator

That sounds very reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants