summaryrefslogtreecommitdiffstats
path: root/Lib/textwrap.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-12-13 23:20:54 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-12-13 23:20:54 (GMT)
commit7c59bc6f2faefbf8c4ef4692fee1f658aa53c6a6 (patch)
tree192915cee35e899422ec26ad83e34d35c198ae5b /Lib/textwrap.py
parentd9c03e0da300bc52d5503fd18a95f897d92bf454 (diff)
downloadcpython-7c59bc6f2faefbf8c4ef4692fee1f658aa53c6a6.zip
cpython-7c59bc6f2faefbf8c4ef4692fee1f658aa53c6a6.tar.gz
cpython-7c59bc6f2faefbf8c4ef4692fee1f658aa53c6a6.tar.bz2
Issue #4163: textwrap module: allow word splitting on a hyphen preceded by a non-ASCII letter.
Diffstat (limited to 'Lib/textwrap.py')
-rw-r--r--Lib/textwrap.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index 867b9d9..1f2e9b4 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -76,7 +76,7 @@ class TextWrapper:
# (after stripping out empty strings).
wordsep_re = re.compile(
r'(\s+|' # any whitespace
- r'[^\s\w]*\w+[a-zA-Z]-(?=\w+[a-zA-Z])|' # hyphenated words
+ r'[^\s\w]*\w+[^0-9\W]-(?=\w+[^0-9\W])|' # hyphenated words
r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash
# This less funky little regex just split on recognized spaces. E.g.