Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt render_snippet exceptions for py3 #5171

Merged
merged 2 commits into from
Jan 27, 2020

Conversation

smotornyuk
Copy link
Member

ckan.lib.render_snippet makes multiple attempts to find a template for rendering and, if failed, throws an exception from the last attempt. Previously it was handled by creating a function-scoped variable outside the try block and it was overridden by except block.

In python 3, variable that stores caught exception implicitly unset right after try/catch so this gives un undefined variable. This PR adapts existing logic so that it works in both versions of python

@amercader amercader self-assigned this Jan 23, 2020
@amercader amercader merged commit 99cadcc into ckan:master Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants