bitbake: toaster: fix urllib imports

Some functions have been moved from urllib to urllib.parse
in python 3. Modifying the code to import unquote, urlencode and
unquote_plus from urllib.parse if import from urllib fails should
make it working on both python 2 and python 3.

(Bitbake rev: b91aa29fa20befd9841678a727bb91100363518f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2016-05-30 16:10:59 +03:00
committed by Richard Purdie
parent 2de58c97a5
commit 2b362f6342
2 changed files with 11 additions and 4 deletions

View File

@@ -38,7 +38,11 @@ import json
import collections
import operator
import re
import urllib
try:
from urllib import unquote_plus
except ImportError:
from urllib.parse import unquote_plus
import logging
logger = logging.getLogger("toaster")