mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue 2635: fix bug in the fix_sentence_endings option to textwrap.fill.
This commit is contained in:
parent
6513466270
commit
fe536f53ea
3 changed files with 9 additions and 0 deletions
|
@ -129,6 +129,10 @@ What a mess!
|
|||
expect = ['And she said, "Go to hell!" Can you believe that?']
|
||||
self.check(wrapper.wrap(text), expect)
|
||||
|
||||
text = 'File stdio.h is nice.'
|
||||
expect = ['File stdio.h is nice.']
|
||||
self.check(wrapper.wrap(text), expect)
|
||||
|
||||
def test_wrap_short(self):
|
||||
# Wrapping to make short lines longer
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ class TextWrapper:
|
|||
sentence_end_re = re.compile(r'[%s]' # lowercase letter
|
||||
r'[\.\!\?]' # sentence-ending punct.
|
||||
r'[\"\']?' # optional end-of-quote
|
||||
r'\Z' # end of chunk
|
||||
% string.lowercase)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue