summaryrefslogtreecommitdiffstats
path: root/Mac/Tools/IDE/PyConsole.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-01-21 23:00:52 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2002-01-21 23:00:52 (GMT)
commit815d2bf067799d519323a373387f342ec387645b (patch)
treee26ebc8bd231b418f77cd4357e7fe9936ecc5ac2 /Mac/Tools/IDE/PyConsole.py
parentc71efe01160653e1d232000889fe38f6cf4936c8 (diff)
downloadcpython-815d2bf067799d519323a373387f342ec387645b.zip
cpython-815d2bf067799d519323a373387f342ec387645b.tar.gz
cpython-815d2bf067799d519323a373387f342ec387645b.tar.bz2
Changes by Donovan Preston (and a few minor ones by me) to make IDE run under
MachoPython. Mainly making sure we don't call routines that don't exist and representing pathnames in a os.separator-neutral format. These shouldn't interfere too much with Just's work on the next generation IDE, I hope.
Diffstat (limited to 'Mac/Tools/IDE/PyConsole.py')
-rw-r--r--Mac/Tools/IDE/PyConsole.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Mac/Tools/IDE/PyConsole.py b/Mac/Tools/IDE/PyConsole.py
index 24fa059..6c0ecd7 100644
--- a/Mac/Tools/IDE/PyConsole.py
+++ b/Mac/Tools/IDE/PyConsole.py
@@ -75,9 +75,11 @@ class ConsoleTextWidget(W.EditText):
if char == Wkeys.returnkey:
text = self.get()[self._inputstart:selstart]
text = string.join(string.split(text, "\r"), "\n")
- saveyield = MacOS.EnableAppswitch(0)
+ if hasattr(MacOS, 'EnableAppswitch'):
+ saveyield = MacOS.EnableAppswitch(0)
self.pyinteractive.executeline(text, self, self._namespace)
- MacOS.EnableAppswitch(saveyield)
+ if hasattr(MacOS, 'EnableAppswitch'):
+ MacOS.EnableAppswitch(saveyield)
selstart, selend = self.getselection()
self._inputstart = selstart
@@ -275,13 +277,15 @@ class PyOutput:
self.w.bind("<activate>", self.activate)
def write(self, text):
- oldyield = MacOS.EnableAppswitch(-1)
+ if hasattr(MacOS, 'EnableAppswitch'):
+ oldyield = MacOS.EnableAppswitch(-1)
try:
self._buf = self._buf + text
if '\n' in self._buf:
self.flush()
finally:
- MacOS.EnableAppswitch(oldyield)
+ if hasattr(MacOS, 'EnableAppswitch'):
+ MacOS.EnableAppswitch(oldyield)
def flush(self):
self.show()