diff options
Diffstat (limited to 'lorrycontroller/gitlab.py')
-rw-r--r-- | lorrycontroller/gitlab.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lorrycontroller/gitlab.py b/lorrycontroller/gitlab.py index a426b0d..6938cae 100644 --- a/lorrycontroller/gitlab.py +++ b/lorrycontroller/gitlab.py @@ -1,4 +1,4 @@ -# Copyright (C) 2016 Codethink Limited +# Copyright (C) 2016-2019 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,9 +13,9 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from __future__ import absolute_import + import re -import urlparse +import urllib.parse import itertools try: import gitlab @@ -46,7 +46,7 @@ class Gitlab(object): '\tpython-gitlab is required with GitLab as the git server') def first(self, predicate, iterable): - return next(itertools.ifilter(predicate, iterable)) + return next(filter(predicate, iterable)) def split_and_unslashify_path(self, path): group, project = path.split('/', 1) @@ -137,6 +137,6 @@ class Gitlab(object): if protocol == 'ssh': return project.ssh_url_to_repo elif protocol in ('http', 'https'): - split = urlparse.urlsplit(project.http_url_to_repo) - return urlparse.urlunsplit(( + split = urllib.parse.urlsplit(project.http_url_to_repo) + return urllib.parse.urlunsplit(( protocol, split.netloc, split.path, '', '')) |