diff options
author | Max Wittig <max.wittig95@gmail.com> | 2019-10-07 21:21:39 +0200 |
---|---|---|
committer | Max Wittig <max.wittig95@gmail.com> | 2019-10-07 21:21:39 +0200 |
commit | 03b7b5b07e1fd2872e8968dd6c29bc3161c6c43a (patch) | |
tree | 225604e232b31539b0ce80e770be79830671266e | |
parent | 35cc8c789fda4977add7f399bf426352b1aa246f (diff) | |
download | gitlab-fix/non-auth.tar.gz |
fix: fix not working without authfix/non-auth
-rw-r--r-- | gitlab/__init__.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index 89253ca..6842303 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -31,7 +31,7 @@ from gitlab.exceptions import * # noqa from gitlab import utils # noqa __title__ = "python-gitlab" -__version__ = "1.12.0" +__version__ = "1.12.1" __author__ = "Gauvain Pocentek" __email__ = "gauvainpocentek@gmail.com" __license__ = "LGPL3" @@ -350,13 +350,12 @@ class Gitlab(object): return url def _set_auth_info(self): - if ( - sum( - bool(arg) - for arg in [self.private_token, self.oauth_token, self.job_token] - ) - != 1 - ): + tokens = [ + token + for token in [self.private_token, self.oauth_token, self.job_token] + if token + ] + if len(tokens) > 1: raise ValueError( "Only one of private_token, oauth_token or job_token should " "be defined" |