Import readline when possible to make the commaninterpreter UI nicer.
diff --git a/Lib/pstats.py b/Lib/pstats.py
index 898871a..ac8cd3a 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -531,6 +531,10 @@
 
 if __name__ == '__main__':
     import cmd
+    try:
+        import readline
+    except:
+        pass
 
     class ProfileBrowser(cmd.Cmd):
         def __init__(self, profile=None):