# HG changeset patch # User Ludovic Chabant # Date 1497331362 25200 # Node ID 41b0c94f9833009d9cfea8d6cc894ceba03444a2 # Parent 8d25f76fce98646f7c7ca3d6893dcd366becdbde refactor: Fix some last instance of using the old API. diff -r 8d25f76fce98 -r 41b0c94f9833 piecrust/templating/jinja/environment.py --- a/piecrust/templating/jinja/environment.py Mon Jun 12 22:22:19 2017 -0700 +++ b/piecrust/templating/jinja/environment.py Mon Jun 12 22:22:42 2017 -0700 @@ -84,12 +84,11 @@ self.globals['pcfail'] = raise_exception def _paginate(self, value, items_per_page=5): - cpi = self.app.env.exec_info_stack.current_page_info - if cpi is None or cpi.page is None or cpi.render_ctx is None: + ctx = self.app.env.render_ctx_stack.current_ctx + if ctx is None or ctx.page is None: raise Exception("Can't paginate when no page has been pushed " "on the execution stack.") - return Paginator(cpi.page, value, - page_num=cpi.render_ctx.page_num, + return Paginator(value, ctx.page, ctx.sub_num, items_per_page=items_per_page) def _formatWith(self, value, format_name):