diff options
| author | Cosimo Lupo <cosimo.lupo@daltonmaag.com> | 2017-06-02 14:41:06 +0100 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-06-02 15:41:06 +0200 |
| commit | 88900e06761794442716c115229bd1f780cfbcef (patch) | |
| tree | 6011ab17b9be02e62ea141e037b7b1afdeafd02d /gitlab/v4 | |
| parent | 38bff3eb43ee6526b3e3b35c8207fac9ef9bc9d9 (diff) | |
| download | gitlab-88900e06761794442716c115229bd1f780cfbcef.tar.gz | |
import urlencode() from six.moves.urllib.parse instead of from urllib (#268)
Fixes AttributeError on Python 3, as `urlencode` function has been moved to `urllib.parse` module.
`six.moves.urllib.parse.urlencode()` is an py2.py3 compatible alias of `urllib.parse.urlencode()` on Python 3, and of `urllib.urlencode()` on Python 2.
Diffstat (limited to 'gitlab/v4')
| -rw-r--r-- | gitlab/v4/objects.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 83790bf..6283149 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -20,9 +20,9 @@ from __future__ import division from __future__ import absolute_import import base64 import json -import urllib import six +from six.moves import urllib import gitlab from gitlab.base import * # noqa @@ -1846,7 +1846,7 @@ class Project(GitlabObject): url = "/projects/%s/repository/tree" % (self.id) params = [] if path: - params.append(urllib.urlencode({'path': path})) + params.append(urllib.parse.urlencode({'path': path})) if ref: params.append("ref=%s" % ref) if params: |
