Index: Lib/site.py
===================================================================
--- Lib/site.py	(revision 59577)
+++ Lib/site.py	(working copy)
@@ -313,11 +313,10 @@
                     sys.stdout.write(prompt)
                     sys.stdout.flush()
                     key = sys.stdin.readline()
-                    if key not in ('', 'q'):
+                    if key.strip() == 'q':
+                        return 
+                    if key not in ('\n','\r',''):
                         key = None
-                if key == 'q':
-                    break
-
 def setcopyright():
     """Set 'copyright' and 'credits' in builtins"""
     builtins.copyright = _Printer("copyright", sys.copyright)
