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

check for urllib3 first, before using urllib2 #49

Open
Some1Somewhere opened this issue Oct 2, 2024 · 0 comments
Open

check for urllib3 first, before using urllib2 #49

Some1Somewhere opened this issue Oct 2, 2024 · 0 comments

Comments

@Some1Somewhere
Copy link

I have another package that installs urllib2, and therefore the import below succeeds, and then proceeds to break in Python 3.12

    import urllib2 as urllib
    URLError = urllib.URLError

If we can upgrade this to check for urllib3 before trying urllib2, then having urllib2 won't break.

|   File "/usr/local/lib/python3.12/site-packages/justext/_compat.py", line 22, in <module>
|     import urllib2 as urllib
|   File "/usr/local/lib/python3.12/site-packages/urllib2.py", line 220
|     raise AttributeError, attr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant