Visitar URL original
Fix #181 · github3py/github3py@75f4575 · GitHub
Skip to content

Commit 75f4575

Browse files
committed
Never monkey with _json. Not even once
1 parent e65e0b8 commit 75f4575

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎github3/structs.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __iter__(self):
6161
if not self.etag and response.headers.get('ETag'):
6262
self.etag = response.headers.get('ETag')
6363

64-
json = self._json(response, 200)
64+
json = self._get_json(response)
6565

6666
if json is None:
6767
break
@@ -88,6 +88,9 @@ def __next__(self):
8888
self.__i__ = self.__iter__()
8989
return next(self.__i__)
9090

91+
def _get_json(self, response):
92+
return self._json(response, 200)
93+
9194
def refresh(self, conditional=False):
9295
self.count = self.original
9396
if conditional:
@@ -110,8 +113,8 @@ def __repr__(self):
110113
return '<SearchIterator [{0}, {1}?{2}]>'.format(self.count, self.path,
111114
urlencode(self.params))
112115

113-
def _json(self, response, status_code):
114-
json = super(SearchIterator, self)._json(response, status_code)
116+
def _get_json(self, response):
117+
json = self._json(response, 200)
115118
# I'm not sure if another page will retain the total_count attribute,
116119
# so if it's not in the response, just set it back to what it used to
117120
# be

0 commit comments

Comments
 (0)