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

Commitd9011da

Browse files
committed
Never monkey with _json. Not even once
1 parent94f34b6 commitd9011da

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
@@ -55,7 +55,7 @@ def __iter__(self):
5555
ifnotself.etagandresponse.headers.get('ETag'):
5656
self.etag=response.headers.get('ETag')
5757

58-
json=self._json(response,200)
58+
json=self._get_json(response)
5959

6060
ifjsonisNone:
6161
break
@@ -82,6 +82,9 @@ def __next__(self):
8282
self.__i__=self.__iter__()
8383
returnnext(self.__i__)
8484

85+
def_get_json(self,response):
86+
returnself._json(response,200)
87+
8588
defrefresh(self,conditional=False):
8689
self.count=self.original
8790
ifconditional:
@@ -104,8 +107,8 @@ def __repr__(self):
104107
return'<SearchIterator [{0}, {1}?{2}]>'.format(self.count,self.path,
105108
urlencode(self.params))
106109

107-
def_json(self,response,status_code):
108-
json=super(SearchIterator,self)._json(response,status_code)
110+
def_get_json(self,response):
111+
json=self._json(response,200)
109112
# I'm not sure if another page will retain the total_count attribute,
110113
# so if it's not in the response, just set it back to what it used to
111114
# be

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp