8000 Do not raise a KeyError while creating a tag · pythonthings/github3.py@a1723a6 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit a1723a6

Browse files
committed
Do not raise a KeyError while creating a tag
1 parent 1431871 commit a1723a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

github3/repos/repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ def create_tag(self, tag, message, sha, obj_type, tagger,
10011001
url = self._build_url('git', 'tags', base_url=self._api)
10021002
json = self._json(self._post(url, data=data), 201)
10031003
if json:
1004-
self.create_ref('refs/tags/' + tag, json['sha'])
1004+
self.create_ref('refs/tags/' + tag, json.get('sha'))
10051005
return self._instance_or_null(Tag, json)
10061006

10071007
@requires_auth

0 commit comments

Comments
 (0)
0