Perform a sanity check on the environment.
(environment)
| 98 | |
| 99 | |
| 100 | def _environment_sanity_check(environment): |
| 101 | """Perform a sanity check on the environment.""" |
| 102 | assert issubclass(environment.undefined, Undefined), 'undefined must ' \ |
| 103 | 'be a subclass of undefined because filters depend on it.' |
| 104 | assert environment.block_start_string != \ |
| 105 | environment.variable_start_string != \ |
| 106 | environment.comment_start_string, 'block, variable and comment ' \ |
| 107 | 'start strings must be different' |
| 108 | assert environment.newline_sequence in ('\r', '\r\n', '\n'), \ |
| 109 | 'newline_sequence set to unknown line ending string.' |
| 110 | return environment |
| 111 | |
| 112 | |
| 113 | class Environment(object): |