mirror of
https://github.com/python/cpython.git
synced 2025-10-24 15:36:26 +00:00
encounters a string with an unmatched quote, by adding a check for
EOF in the 'quotes' state.
This commit is contained in:
parent
92d8917f83
commit
9d56cd100e
1 changed files with 5 additions and 0 deletions
|
|
@ -123,6 +123,11 @@ class shlex:
|
||||||
if nextchar == self.state:
|
if nextchar == self.state:
|
||||||
self.state = ' '
|
self.state = ' '
|
||||||
break
|
break
|
||||||
|
elif not nextchar: # end of file
|
||||||
|
if self.debug >= 2:
|
||||||
|
print "shlex: I see EOF in quotes state"
|
||||||
|
# XXX what error should be raised here?
|
||||||
|
raise ValueError, "No closing quotation"
|
||||||
elif self.state == 'a':
|
elif self.state == 'a':
|
||||||
if not nextchar:
|
if not nextchar:
|
||||||
self.state = None # end of file
|
self.state = None # end of file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue