[oe-commits] [openembedded-core] 22/25: scripts: python3: fix urlparse imports
git at git.openembedded.org
git at git.openembedded.org
Sat May 21 11:06:26 UTC 2016
rpurdie pushed a commit to branch python3
in repository openembedded-core.
commit 723314123c85c5f8fd8ea21512bc6b1ec8466ba6
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Thu May 19 12:33:44 2016 +0300
scripts: python3: fix urlparse imports
Used urllib.parse instead of urlparse to make code
working in python 3.
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
scripts/lib/recipetool/create.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index aba3851..9ca682f 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -24,7 +24,7 @@ import re
import json
import logging
import scriptutils
-import urlparse
+from urllib.parse import urlparse, urldefrag, urlsplit
import hashlib
logger = logging.getLogger('recipetool')
@@ -279,7 +279,7 @@ def determine_from_url(srcuri):
"""Determine name and version from a URL"""
pn = None
pv = None
- parseres = urlparse.urlparse(srcuri.lower().split(';', 1)[0])
+ parseres = urlparse(srcuri.lower().split(';', 1)[0])
if parseres.path:
if 'github.com' in parseres.netloc:
res = re.search(r'.*/(.*?)/archive/(.*)-final\.(tar|zip)', parseres.path)
@@ -342,11 +342,11 @@ def create_recipe(args):
srcrev = '${AUTOREV}'
if '://' in args.source:
# Fetch a URL
- fetchuri = reformat_git_uri(urlparse.urldefrag(args.source)[0])
+ fetchuri = reformat_git_uri(urldefrag(args.source)[0])
if args.binary:
# Assume the archive contains the directory structure verbatim
# so we need to extract to a subdirectory
- fetchuri += ';subdir=%s' % os.path.splitext(os.path.basename(urlparse.urlsplit(fetchuri).path))[0]
+ fetchuri += ';subdir=%s' % os.path.splitext(os.path.basename(urlsplit(fetchuri).path))[0]
srcuri = fetchuri
rev_re = re.compile(';rev=([^;]+)')
res = rev_re.search(srcuri)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list