[Python-checkins] python/dist/src/Lib textwrap.py,1.13,1.14
gward@users.sourceforge.net
gward@users.sourceforge.net
Thu, 22 Aug 2002 14:04:23 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv5474
Modified Files:
textwrap.py
Log Message:
Fix SF bug #596434: tweak wordsep_re so "--foo-bar" now splits
into /--foo-/bar/ rather than /--/foo-/bar/. Needed for Optik and
Docutils to handle Unix-style command-line options properly.
Index: textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** textwrap.py 16 Jul 2002 21:35:23 -0000 1.13
--- textwrap.py 22 Aug 2002 21:04:21 -0000 1.14
***************
*** 56,60 ****
# (after stripping out empty strings).
wordsep_re = re.compile(r'(\s+|' # any whitespace
! r'\w{2,}-(?=\w{2,})|' # hyphenated words
r'(?<=\w)-{2,}(?=\w))') # em-dash
--- 56,60 ----
# (after stripping out empty strings).
wordsep_re = re.compile(r'(\s+|' # any whitespace
! r'-*\w{2,}-(?=\w{2,})|' # hyphenated words
r'(?<=\w)-{2,}(?=\w))') # em-dash