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

Support newer versions of pychromecast #32

Merged
merged 2 commits into from Dec 16, 2016
Merged

Conversation

etandel
Copy link
Contributor

@etandel etandel commented Dec 16, 2016

When I tried to run mkchromecast on my Arch Linux, I got an AttributeError: module 'pychromecast' has no attribute 'get_chromecasts_as_dict'. It seems the current version of pychromecast does not have this function anymore.

I added support for the current version of pychromecast while making the code backwards compatible.

BTW, thanks for this great project!

@muammar
Copy link
Owner

muammar commented Dec 16, 2016

Thank you very much for this pull request!. I wanted to discuss something with you before accepting it. I have seen you have used hasattr, but the other day I read this: https://hynek.me/articles/hasattr/. Wouldn't it be better to use try and except instead of hasattr? Especially because Debian based distros are working still with python2. What's your opinion on this?.

@muammar
Copy link
Owner

muammar commented Dec 16, 2016

More information about AttributeError: module 'pychromecast' has no attribute 'get_chromecasts_as_dict': https://github.com/balloob/pychromecast/pull/138/files.

@etandel
Copy link
Contributor Author

etandel commented Dec 16, 2016

Wouldn't it be better to use try and except instead of hasattr

Indeed, it is and I'll be uploading a fix in a few minutes. I had no idea about this behavior, thanks for the link!

@etandel
Copy link
Contributor Author

etandel commented Dec 16, 2016

Done.

@muammar
Copy link
Owner

muammar commented Dec 16, 2016

Thank you @etandel !

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

Successfully merging this pull request may close these issues.

None yet

2 participants