Skip to content

Commit 3320973

Browse files
committed
Merge pull request copitux#27 from DataDog/master
Allow you to set a timeout for the Github client
2 parents 05be8bb + 63a57cb commit 3320973

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pygithub3/core/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def __set_params(self, config):
5656
self.requester.params.append(per_page)
5757
if config.get('verbose'):
5858
self.requester.config = {'verbose': config['verbose']}
59+
if config.get('timeout'):
60+
self.requester.timeout = config['timeout']
5961

6062
def __parse_kwargs(func):
6163
""" Decorator to put extra args into requests.params """

pygithub3/services/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Service(object):
1818
:param int per_page: Items in each page of multiple returns
1919
:param str base_url: To support another github-related API (untested)
2020
:param stream verbose: Stream to write debug logs
21+
:param timeout float: Timeout for requests
2122
2223
You can configure the **authentication** with BasicAuthentication (login
2324
and password) and with `OAuth <http://developer.github.com/v3/oauth/>`_ (

0 commit comments

Comments
 (0)