[pyrepl-checkins] r7801 - in pyrepl/trunk/pyrepl: . pyrepl

bob at codespeak.net bob at codespeak.net
Fri Dec 10 00:03:44 MET 2004


Author: bob
Date: Fri Dec 10 00:03:43 2004
New Revision: 7801

Modified:
   pyrepl/trunk/pyrepl/pyrepl/python_reader.py
   pyrepl/trunk/pyrepl/pythoni
Log:
move fix to python_reader instead



Modified: pyrepl/trunk/pyrepl/pyrepl/python_reader.py
==============================================================================
--- pyrepl/trunk/pyrepl/pyrepl/python_reader.py	(original)
+++ pyrepl/trunk/pyrepl/pyrepl/python_reader.py	Fri Dec 10 00:03:43 2004
@@ -29,6 +29,13 @@
     import cPickle as pickle
 except ImportError:
     import pickle
+try:
+    import imp
+    imp.find_module("twisted")
+except ImportError:
+    default_interactmethod = "interact"
+else:
+    default_interactmethod = "twistedinteract"
 
 CommandCompiler = code.CommandCompiler
 
@@ -321,7 +328,7 @@
         self.cocoainteracter = CocoaInteracter.alloc().init(self, inputfilehandle, outputfilehandle)
         
         
-def main(use_pygame_console=0, interactmethod="twistedinteract"):
+def main(use_pygame_console=0, interactmethod=default_interactmethod):
     si, se, so = sys.stdin, sys.stderr, sys.stdout
     try:
         if 0 and use_pygame_console: # pygame currently borked

Modified: pyrepl/trunk/pyrepl/pythoni
==============================================================================
--- pyrepl/trunk/pyrepl/pythoni	(original)
+++ pyrepl/trunk/pyrepl/pythoni	Fri Dec 10 00:03:43 2004
@@ -33,12 +33,4 @@
 # whizzy feature:  graft pyrepl support onto pdb
 #pdb.Pdb = cmdrepl.replize(pdb.Pdb, 1)
 
-try:
-    import imp
-    imp.find_module("twisted")
-except ImportError:
-    interactmethod="interact"
-else:
-    interactmethod="twistedinteract"
-
-main(use_pygame_console=('pg' in sys.argv), interactmethod=interactmethod)
+main(use_pygame_console=('pg' in sys.argv))


More information about the pyrepl-checkins mailing list