Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

only import the webbrowser module when needed #78

Closed
wants to merge 2 commits into from
Closed

only import the webbrowser module when needed #78

wants to merge 2 commits into from

Conversation

thijstriemstra
Copy link
Collaborator

No description provided.

@thijstriemstra
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
Copy link
Collaborator Author

@sybrenstuvel ping

@thijstriemstra
Copy link
Collaborator Author

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

@sybrenstuvel
Copy link
Owner

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
Copy link
Owner

Cherry-picked the original pull request in d565715

@thijstriemstra thijstriemstra deleted the patch-1 branch May 7, 2017 20:44
@thijstriemstra
Copy link
Collaborator Author

@sybrenstuvel thanks! can we have a new release?

@sybrenstuvel
Copy link
Owner

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

@sybrenstuvel
Copy link
Owner

2.3 has been released.

@thijstriemstra
Copy link
Collaborator Author

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants