Skip to content

Commit

Permalink
Use six.moves.urllib.
Browse files Browse the repository at this point in the history
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
  • Loading branch information
omasanori committed Jun 10, 2014
1 parent def6544 commit ca3aa1e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
8 changes: 1 addition & 7 deletions pelican/contents.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
from six.moves.urllib.parse import unquote
from six.moves.urllib.parse import (unquote, urlparse, urlunparse)

import copy
import locale
Expand All @@ -11,14 +11,8 @@
import re
import sys

try:
from urlparse import urlparse, urlunparse
except ImportError:
from urllib.parse import urlparse, urlunparse

from datetime import datetime


from pelican import signals
from pelican.settings import DEFAULT_CONFIG
from pelican.utils import (slugify, truncate_html_words, memoized, strftime,
Expand Down
9 changes: 3 additions & 6 deletions pelican/tools/pelican_import.py
Expand Up @@ -6,15 +6,9 @@
try:
# py3k import
from html.parser import HTMLParser
from urllib.request import urlretrieve
from urllib.parse import urlparse
from urllib.error import URLError
except ImportError:
# py2 import
from HTMLParser import HTMLParser # NOQA
from urllib import urlretrieve
from urlparse import urlparse
from urllib2 import URLError
import os
import re
import subprocess
Expand All @@ -23,6 +17,9 @@
import logging

from codecs import open
from six.moves.urllib.error import URLError
from six.moves.urllib.parse import urlparse
from six.moves.urllib.request import urlretrieve

from pelican.utils import slugify
from pelican.log import init
Expand Down
4 changes: 1 addition & 3 deletions pelican/writers.py
Expand Up @@ -8,12 +8,10 @@

if not six.PY3:
from codecs import open
from urlparse import urlparse
else:
from urllib.parse import urlparse

from feedgenerator import Atom1Feed, Rss201rev2Feed
from jinja2 import Markup
from six.moves.urllib.parse import urlparse

from pelican.paginator import Paginator
from pelican.utils import (get_relative_path, path_to_url, set_date_tzinfo,
Expand Down

0 comments on commit ca3aa1e

Please sign in to comment.