summaryrefslogtreecommitdiffstats
path: root/Lib/shlex.py
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2003-04-20 01:57:03 (GMT)
committerGustavo Niemeyer <gustavo@niemeyer.net>2003-04-20 01:57:03 (GMT)
commit48f3dcc93e57e75e43f9e1a82daa02d2c2f29ec8 (patch)
tree565d184f58251dabce4907b80cf999593d888c17 /Lib/shlex.py
parentcf146d31e72467db55a97169563c813706cef681 (diff)
downloadcpython-48f3dcc93e57e75e43f9e1a82daa02d2c2f29ec8.zip
cpython-48f3dcc93e57e75e43f9e1a82daa02d2c2f29ec8.tar.gz
cpython-48f3dcc93e57e75e43f9e1a82daa02d2c2f29ec8.tar.bz2
- Changed shlex.split() method to have more useful and
meaningful parameters.
Diffstat (limited to 'Lib/shlex.py')
-rw-r--r--Lib/shlex.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/shlex.py b/Lib/shlex.py
index dd10447..b302699 100644
--- a/Lib/shlex.py
+++ b/Lib/shlex.py
@@ -271,9 +271,11 @@ class shlex:
raise StopIteration
return token
-def split(s, posix=True, spaces=True):
- lex = shlex(s, posix=posix)
- lex.whitespace_split = spaces
+def split(s, comments=False):
+ lex = shlex(s, posix=True)
+ lex.whitespace_split = True
+ if not comments:
+ lex.commenters = ''
return list(lex)
if __name__ == '__main__':