Duh. cmdqueue should be an instance variable, not a class variable.
This was introduced in 1998 in rev. 1.13, where I imported extensive
patches that, I am sad to say, I didn't review as carefully as I
should have.
diff --git a/Lib/cmd.py b/Lib/cmd.py
index bd4e3cb..f0637ed 100644
--- a/Lib/cmd.py
+++ b/Lib/cmd.py
@@ -68,7 +68,6 @@
identchars = IDENTCHARS
ruler = '='
lastcmd = ''
- cmdqueue = []
intro = None
doc_leader = ""
doc_header = "Documented commands (type help <topic>):"
@@ -86,6 +85,7 @@
automatically.
"""
+ self.cmdqueue = []
if completekey:
try:
import readline