Line 245 is paginator.num_pages and this is num_pages.  Unless there's something too subtle for me going on here...