No need to import sys or linecache.  (Andrew Dalke & kjpylint)
diff --git a/Lib/cmd.py b/Lib/cmd.py
index 9ca0010..7cb5a02 100644
--- a/Lib/cmd.py
+++ b/Lib/cmd.py
@@ -36,8 +36,6 @@
 #
 
 import string
-import sys
-import linecache
 
 PROMPT = '(Cmd) '
 IDENTCHARS = string.letters + string.digits + '_'