Files
tmhr/venv/lib/python3.10/site-packages/django_gravatar/compat.py
2024-02-23 10:30:02 +00:00

25 lines
641 B
Python

"""
This module provides compatibility with older versions of Django and Python
"""
try:
from urllib.parse import urlparse, parse_qs, quote_plus, urlencode
except ImportError: # Python 2
from urlparse import urlparse, parse_qs
from urllib import quote_plus, urlencode
try:
from urllib.request import Request, urlopen
except ImportError: # Python 2
from urllib2 import Request, urlopen
try:
from urllib.error import HTTPError
except ImportError: # Python 2
from urllib2 import HTTPError
try:
from urllib.error import URLError
except ImportError: # Python 2
from urllib2 import URLError