diff options
author | Greg Ward <gward@python.net> | 2002-08-22 21:04:21 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2002-08-22 21:04:21 (GMT) |
commit | cce4d67fc466b902a6b553c731d7be700b506dfd (patch) | |
tree | 16469de329031a9d4c06fb7cd608ed02eb20b577 /Lib/textwrap.py | |
parent | ae4693129a49cf4ab9feff33c4658873e85f2083 (diff) | |
download | cpython-cce4d67fc466b902a6b553c731d7be700b506dfd.zip cpython-cce4d67fc466b902a6b553c731d7be700b506dfd.tar.gz cpython-cce4d67fc466b902a6b553c731d7be700b506dfd.tar.bz2 |
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.
Diffstat (limited to 'Lib/textwrap.py')
-rw-r--r-- | Lib/textwrap.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/textwrap.py b/Lib/textwrap.py index fb8d3b8..8b3a265 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -55,7 +55,7 @@ class TextWrapper: # Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option! # (after stripping out empty strings). wordsep_re = re.compile(r'(\s+|' # any whitespace - r'\w{2,}-(?=\w{2,})|' # hyphenated words + r'-*\w{2,}-(?=\w{2,})|' # hyphenated words r'(?<=\w)-{2,}(?=\w))') # em-dash # XXX will there be a locale-or-charset-aware version of |