##// END OF EJS Templates
Removed unnecessary regexp part. Added comments about whether using a capturing group is necessary.
Eric O. LEBIGOT (EOL) -
Show More
@@ -381,13 +381,15 b' def _strip_prompts(prompt_re):'
381 @CoroutineInputTransformer.wrap
381 @CoroutineInputTransformer.wrap
382 def classic_prompt():
382 def classic_prompt():
383 """Strip the >>>/... prompts of the Python interactive shell."""
383 """Strip the >>>/... prompts of the Python interactive shell."""
384 prompt_re = re.compile(r'^(>>> ?|^\.\.\. ?)')
384 # FIXME: non-capturing version (?:...) usable?
385 prompt_re = re.compile(r'^(>>> ?|\.\.\. ?)')
385 return _strip_prompts(prompt_re)
386 return _strip_prompts(prompt_re)
386
387
387 @CoroutineInputTransformer.wrap
388 @CoroutineInputTransformer.wrap
388 def ipy_prompt():
389 def ipy_prompt():
389 """Strip IPython's In [1]:/...: prompts."""
390 """Strip IPython's In [1]:/...: prompts."""
390 prompt_re = re.compile(r'^(In \[\d+\]: |^\ \ \ \.\.\.+: )')
391 # FIXME: non-capturing version (?:...) usable?
392 prompt_re = re.compile(r'^(In \[\d+\]: |\ \ \ \.\.\.+: )')
391 return _strip_prompts(prompt_re)
393 return _strip_prompts(prompt_re)
392
394
393
395
General Comments 0
You need to be logged in to leave comments. Login now