##// END OF EJS Templates
Merge pull request #13532 from TomNicholas/dont_strip_all_decorators...
Matthias Bussonnier -
r27547:4f151b68 merge
parent child Browse files
Show More
@@ -220,6 +220,8 b' except Exception:'
220 220 # for tokenizing blocks
221 221 COMMENT, INPUT, OUTPUT = range(3)
222 222
223 PSEUDO_DECORATORS = ["suppress", "verbatim", "savefig", "doctest"]
224
223 225 #-----------------------------------------------------------------------------
224 226 # Functions and class declarations
225 227 #-----------------------------------------------------------------------------
@@ -263,11 +265,17 b' def block_parser(part, rgxin, rgxout, fmtin, fmtout):'
263 265 block.append((COMMENT, line))
264 266 continue
265 267
266 if line_stripped.startswith('@'):
267 # Here is where we assume there is, at most, one decorator.
268 # Might need to rethink this.
269 decorator = line_stripped
270 continue
268 if any(
269 line_stripped.startswith("@" + pseudo_decorator)
270 for pseudo_decorator in PSEUDO_DECORATORS
271 ):
272 if decorator:
273 raise RuntimeError(
274 "Applying multiple pseudo-decorators on one line is not supported"
275 )
276 else:
277 decorator = line_stripped
278 continue
271 279
272 280 # does this look like an input line?
273 281 matchin = rgxin.match(line)
General Comments 0
You need to be logged in to leave comments. Login now