1 2 3 4 5 6 7 | @register.filter def smartypants(value): try: import smartypants return smartypants.smartyPants(value) except: return value |
1 2 3 4 5 6 7 | @register.filter def smartypants(value): try: import smartypants return smartypants.smartyPants(value) except: return value |
Comments
An "except ImportError" would be better form there, assuming that the intent of the bare except is to handle cases where smartypants is not available.
#