Old versions of python-six shipped on e.g. Debian 7, Ubuntu 12.04 and
openSUSE 12.3 do not contain urllib.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
from six.moves import configparser
import sys
import os, os.path
-from six.moves import urllib
import subprocess
import tty, termios
import re
...
GbpError: URL contains invalid ~username expansion.
"""
- frags = urllib.parse.urlparse(remote_url)
+ # Fix for old distros like Debian 7, Ubuntu 12.04 and openSUSE 12.3 with old
+ # python-six that doesn't have urllib
+ try:
+ from six.moves import urllib
+ frags = urllib.parse.urlparse(remote_url)
+ except ImportError:
+ import urlparse
+ frags = urlparse.urlparse(remote_url)
if frags.scheme in ['ssh', 'git+ssh', '']:
scheme = frags.scheme
else: