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

Import webbrowser only when necessary #287

Closed
jefferyto opened this issue Dec 12, 2020 · 2 comments · Fixed by #288
Closed

Import webbrowser only when necessary #287

jefferyto opened this issue Dec 12, 2020 · 2 comments · Fixed by #288

Comments

@jefferyto
Copy link

Hello 👋 I'm one of the Python maintainers for the OpenWrt packages feed. We have a user who wrote a script using MSAL and encountered an import error for webbrowser when run on their device (openwrt/packages#14198).

While the webbrowser module is part of the Python standard library, we don't ship webbrowser in our Python package to save disk space. AFAIK there also is no web browser package available for OpenWrt.

I see that webbrowser is only used in one place (_browse() in msal/oauth2cli/authcode.py). Would you be willing to accept a PR to move the import webbrowser statement into _browse()? This should fix the import error for the user (their script is non-interactive and does not need to open a browser) and allow our Python package to continue to not ship the webbrowser module.

@rayluo
Copy link
Collaborator

rayluo commented Dec 14, 2020

@jefferyto Thanks for bringing this to our attention. Will that PR work?

@jefferyto
Copy link
Author

Yes that should work - thanks!

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