8000 Merge pull request #899 from cs-shadow/github-url-to-api · shalevy1/github3.py@49c0ae7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 49c0ae7

Browse files
authored
Merge pull request sigmavirus24#899 from cs-shadow/github-url-to-api
Use API url instead of hard-coding GitHub url
2 parents 60e4b06 + 84f5da2 commit 49c0ae7

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

AUTHORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,5 @@ Contributors
168168
- Taylor Edmiston (@tedmiston)
169169

170170
- Jenny Li (@imjennyli)
171+
172+
- Chandan Singh (@cs-shadow)

src/github3/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def ratelimit_remaining(self):
259259
260260
:returns: int
261261
"""
262-
json = self._json(self._get(self._github_url + '/rate_limit'), 200)
262+
json = self._json(self._get(self._build_url('rate_limit')), 200)
263263
core = json.get('resources', {}).get(self._ratelimit_resource, {})
264264
self._remaining = core.get('remaining', 0)
265265
return self._remaining

src/github3/orgs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ def project(self, id, etag=None):
963963
:rtype:
964964
:class:`~github3.projects.Project`
965965
"""
966-
url = self._build_url('projects', id, base_url=self._github_url)
966+
url = self._build_url('projects', id)
967967
json = self._json(self._get(url, headers=Project.CUSTOM_HEADERS), 200)
968968
return self._instance_or_null(Project, json)
969969

src/github3/repos/repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,7 @@ def project(self, id, etag=None):
19801980
:rtype:
19811981
:class:`~github3.projects.Project`
19821982
"""
1983-
url = self._build_url('projects', id, base_url=self._github_url)
1983+
url = self._build_url('projects', id)
19841984
json = self._json(self._get(
19851985
url, headers=projects.Project.CUSTOM_HEADERS), 200)
19861986
return self._instance_or_null(projects.Project, json)

0 commit comments

Comments
 (0)
0