Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit75f4575

Browse files
committed
Never monkey with _json. Not even once
1 parente65e0b8 commit75f4575

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎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
ifnotself.etagandresponse.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
ifjsonisNone:
6767
break
@@ -88,6 +88,9 @@ def __next__(self):
8888
self.__i__=self.__iter__()
8989
returnnext(self.__i__)
9090

91+
def_get_json(self,response):
92+
returnself._json(response,200)
93+
9194
defrefresh(self,conditional=False):
9295
self.count=self.original
9396
ifconditional:
@@ -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)

[8]ページ先頭

©2009-2025 Movatter.jp