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
|
@ -123,6 +123,11 @@ class shlex:
|
|||
if nextchar == self.state:
|
||||
self.state = ' '
|
||||
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':
|
||||
if not nextchar:
|
||||
self.state = None # end of file
|
||||
|
|
Loading…
Reference in New Issue