Skip to content

Commit

Permalink
Handle urllib imports in Python 2 and 3 correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
miso-belica authored Feb 24, 2025
1 parent 7fae5d4 commit c070f11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions justext/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
string_types = (bytes, unicode,)


try:
import urllib2 as urllib
URLError = urllib.URLError
except ImportError:
if PY3:
import urllib.request as urllib
from urllib.error import URLError
else:
import urllib2 as urllib
URLError = urllib.URLError


try:
Expand Down

0 comments on commit c070f11

Please sign in to comment.