diff --git a/github/PaginatedList.py b/github/PaginatedList.py index b71d55dc..7e1ee234 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -97,7 +97,7 @@ class PaginatedList(PaginatedListBase): self.__firstUrl = firstUrl self.__firstParams = firstParams or () self.__nextUrl = firstUrl - self.__nextParams = firstParams + self.__nextParams = firstParams or {} if self.__requester.per_page != 30: self.__nextParams["per_page"] = self.__requester.per_page diff --git a/github/tests/PaginatedList.py b/github/tests/PaginatedList.py index 731eb6bf..1658d3ee 100644 --- a/github/tests/PaginatedList.py +++ b/github/tests/PaginatedList.py @@ -15,7 +15,8 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . import Framework - +import CommitComment +from github.PaginatedList import PaginatedList as PaginatedListImpl class PaginatedList(Framework.TestCase): def setUp(self): @@ -88,6 +89,15 @@ class PaginatedList(Framework.TestCase): self.g.per_page = 100 self.assertEqual(self.g.per_page, 100) self.assertEqual(len(list(self.repo.get_issues())), 456) + + def testCustomPerPageWithNoUrlParams(self): + self.g.per_page = 100 + paginated_list = PaginatedListImpl( + CommitComment.CommitComment, + self.repo._requester, + self.repo.url + "/comments", + None + ) def testCustomPerPageWithGetPage(self): self.g.per_page = 100