Tim Peters added the comment:

Serhiy, I don't see the regexp '(?:.*$\n?)*' anywhere in doctest.py.  Are you 
talking about the _EXAMPLE_RE regexp?  That's the closest I see.

If that's the case, the "nothing to repeat" error is incorrect:  _EXAMPLE_RE 
also contains a negative lookahead assertion '(?![ ]*$)' to ensure that the 
later '.*$\n?' part never tries to match an empty string.

That said, it takes some intelligence to realize that the negative lookahead 
assertion prevents repeating an empty match in this regexp, so it may not be 
easy to fix this false positive.

A compromise may be to replace

.*$\n?

with

.+$\n? | .*$\n

Both branches then "obviously" consume at least one character.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18647>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to