move ulib and urlparse to compat

This commit is contained in:
agnewee 2017-12-04 23:55:25 +08:00
parent e2c73ac487
commit a72791507f
2 changed files with 6 additions and 9 deletions

View File

@ -4,10 +4,14 @@ import sys
PY2 = sys.version_info[0] == 2
# urljoin
# urllib, urlparse and urljoin
if PY2:
import urllib as ulib
import urlparse
from urlparse import urljoin
else:
import urllib.request as ulib
import urllib.parse as urlparse
from urllib.parse import urljoin
# Dictionary iteration

View File

@ -1,16 +1,9 @@
import os
import shutil
import tempfile
from pydu.compat import PY2, string_types
from pydu.compat import string_types, ulib, urlparse
from pydu.string import safeunicode
if PY2:
import urllib as ulib
import urlparse
else:
import urllib.request as ulib
import urllib.parse as urlparse
class FileName(object):
@staticmethod