Skip to content

Commit d1f8689

Browse files
author
Nat Williams
committed
pass body to pull_requests.merge properly
1 parent 4539f80 commit d1f8689

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pygithub3/services/pull_requests/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ def merge(self, number, message='', user=None, repo=None):
120120
:param str user: Username
121121
:param str repo: Repository
122122
123+
This currently raises an HTTP 405 error if the request is not
124+
mergable.
125+
123126
"""
124-
# so, the API docs don't actually say what the status code will be in
125-
# the case of a merge failure. I hope it's not a 404.
127+
body = {'commit_message': message}
126128
return self._put(
127129
self.make_request('pull_requests.merge', number=number,
128-
message=message, user=user, repo=repo)
130+
body=body, user=user, repo=repo)
129131
)

0 commit comments

Comments
 (0)