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

only import the webbrowser module when needed #78

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@thijstriemstra
Copy link
Collaborator

thijstriemstra commented Jan 26, 2017

No description provided.

@thijstriemstra

This comment has been minimized.

Copy link
Collaborator Author

thijstriemstra commented Jan 26, 2017

I'm using this great library with pyqt and when I want to freeze the files it complains the webbrowser module isn't available.

 File ":/flickrapi/tokencache.py", line 9, in <module>
 File "bootstrap.py", line 969, in _find_and_load
 File "bootstrap.py", line 958, in _find_and_load_unlocked
 File "bootstrap.py", line 664, in _load_unlocked
 File "bootstrap.py", line 634, in _load_backward_compatible
 File ":/flickrapi/auth.py", line 21, in <module>
 File "bootstrap.py", line 969, in _find_and_load
 File "bootstrap.py", line 956, in _find_and_load_unlocked
 ImportError: No module named 'webbrowser'

This is correct because my embedded application doesn't use, or have access, to a webbrowser, so I excluded this module. Considering that I don't need to launch a browser ever (already have the token from elsewhere) I suggest moving the import so it doesn't bother non-web apps.

@thijstriemstra

This comment has been minimized.

Copy link
Collaborator Author

thijstriemstra commented Jan 30, 2017

@thijstriemstra

This comment has been minimized.

Copy link
Collaborator Author

thijstriemstra commented Jan 30, 2017

Also successfully used requests-futures to make the requests call async. Included in PR.

@sybrenstuvel

This comment has been minimized.

Copy link
Owner

sybrenstuvel commented Feb 6, 2017

Please don't add unrelated features to existing pull requests. I've looked at Requests-Futures, and it requires Python >= 3.4. Even though I'd love to live in a world where everybody moved from Python 2 to 3, that's not the world we live in right now, so I can't drop Python 2 support just for this feature.

@sybrenstuvel

This comment has been minimized.

Copy link
Owner

sybrenstuvel commented Feb 6, 2017

Cherry-picked the original pull request in d565715

@thijstriemstra thijstriemstra deleted the thijstriemstra:patch-1 branch May 7, 2017

@thijstriemstra

This comment has been minimized.

Copy link
Collaborator Author

thijstriemstra commented May 7, 2017

@sybrenstuvel thanks! can we have a new release?

@sybrenstuvel

This comment has been minimized.

Copy link
Owner

sybrenstuvel commented May 7, 2017

Yeah, will do that tomorrow after you're done sending more awesomeness in your pull requests 😎👍

@sybrenstuvel

This comment has been minimized.

Copy link
Owner

sybrenstuvel commented May 8, 2017

2.3 has been released.

@thijstriemstra

This comment has been minimized.

Copy link
Collaborator Author

thijstriemstra commented May 8, 2017

Thanks!

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