diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-06-07 21:11:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 21:11:56 +0200 |
commit | bbefb9936a18909d28d0f81b6ce99d4981ab8148 (patch) | |
tree | 50a2a05c4a99a5c18b6f6f0d99bdf40b05f17d98 /gitlab/cli.py | |
parent | 92ca5c4f9e2c3a8651761c9b13a290df669d62a4 (diff) | |
parent | 3fa24ea8f5af361f39f1fb56ec911d381b680943 (diff) | |
download | gitlab-bbefb9936a18909d28d0f81b6ce99d4981ab8148.tar.gz |
Merge pull request #519 from jouve/silence
silence logs/warnings in unittests
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index 4d41b83..4870192 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -120,7 +120,8 @@ def _parse_value(v): # If the user-provided value starts with @, we try to read the file # path provided after @ as the real value. Exit on any error. try: - return open(v[1:]).read() + with open(v[1:]) as fl: + return fl.read() except Exception as e: sys.stderr.write("%s\n" % e) sys.exit(1) |