summaryrefslogtreecommitdiff
path: root/django/utils/feedgenerator.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-07-20 15:36:52 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-07-22 09:29:55 +0200
commit0d914d08a0d7b5a1521f498a8047971fe6cd61e7 (patch)
treed0ab08b0b5b2041bd796c10a26a358ae60d0914a /django/utils/feedgenerator.py
parentbdca5ea345c548a82a80d198906818c9ccbef896 (diff)
[py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases to keey it easy to identify where the functions come from.
Diffstat (limited to 'django/utils/feedgenerator.py')
-rw-r--r--django/utils/feedgenerator.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py
index 3dc66a68c6..6498aaf57c 100644
--- a/django/utils/feedgenerator.py
+++ b/django/utils/feedgenerator.py
@@ -24,7 +24,10 @@ http://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004/
from __future__ import unicode_literals
import datetime
-import urlparse
+try:
+ from urllib.parse import urlparse
+except ImportError: # Python 2
+ from urlparse import urlparse
from django.utils.xmlutils import SimplerXMLGenerator
from django.utils.encoding import force_unicode, iri_to_uri
from django.utils import datetime_safe
@@ -67,7 +70,7 @@ def get_tag_uri(url, date):
See http://web.archive.org/web/20110514113830/http://diveintomark.org/archives/2004/05/28/howto-atom-id
"""
- bits = urlparse.urlparse(url)
+ bits = urlparse(url)
d = ''
if date is not None:
d = ',%s' % datetime_safe.new_datetime(date).strftime('%Y-%m-%d')