summaryrefslogtreecommitdiffstats
path: root/Lib/shlex.py
diff options
context:
space:
mode:
authorEvan <evanunderscore@gmail.com>2019-06-01 19:09:22 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2019-06-01 19:09:22 (GMT)
commit56624a99a916fd27152d5b23364303acc0d707de (patch)
tree469ecf27c685101302f1c9c365f394df174e68e9 /Lib/shlex.py
parent2b843ac0ae745026ce39514573c5d075137bef65 (diff)
downloadcpython-56624a99a916fd27152d5b23364303acc0d707de.zip
cpython-56624a99a916fd27152d5b23364303acc0d707de.tar.gz
cpython-56624a99a916fd27152d5b23364303acc0d707de.tar.bz2
bpo-28595: Allow shlex whitespace_split with punctuation_chars (GH-2071)
Diffstat (limited to 'Lib/shlex.py')
-rw-r--r--Lib/shlex.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/shlex.py b/Lib/shlex.py
index fb1130d..edea077 100644
--- a/Lib/shlex.py
+++ b/Lib/shlex.py
@@ -246,7 +246,8 @@ class shlex:
escapedstate = 'a'
self.state = nextchar
elif (nextchar in self.wordchars or nextchar in self.quotes
- or self.whitespace_split):
+ or (self.whitespace_split and
+ nextchar not in self.punctuation_chars)):
self.token += nextchar
else:
if self.punctuation_chars: