Bug reported by Tobias Thelen: missing "self." in assignment target.
diff --git a/Lib/shlex.py b/Lib/shlex.py
index 8b4ac7a..173edde 100644
--- a/Lib/shlex.py
+++ b/Lib/shlex.py
@@ -95,7 +95,7 @@
                     self.pushback = [nextchar] + self.pushback
                     if self.debug >= 2:
                         print "I see punctuation in word state"
-                    state = ' '
+                    self.state = ' '
                     if self.token:
                         break	# emit current token
                     else: