Commit 62a103b2 authored by Just van Rossum's avatar Just van Rossum

workaround so the (otherwise still broken) IDE can at least quit in the Python...

workaround so the (otherwise still broken) IDE can at least quit in the Python 2.2 Jaguar addon install
parent 09705f0b
...@@ -59,18 +59,10 @@ class PythonIDE(Wapplication.Application): ...@@ -59,18 +59,10 @@ class PythonIDE(Wapplication.Application):
if debug_stderr: if debug_stderr:
sys.stderr = debug_stderr sys.stderr = debug_stderr
for path in sys.argv[1:]: for path in sys.argv[1:]:
if path.startswith("-p"):
# process number added by the OS
continue
self.opendoc(path) self.opendoc(path)
try:
import Wthreading
except ImportError:
self.mainloop()
else:
if Wthreading.haveThreading:
self.mainthread = Wthreading.Thread("IDE event loop", self.mainloop)
self.mainthread.start()
#self.mainthread.setResistant(1)
Wthreading.run()
else:
self.mainloop() self.mainloop()
def makeusermenus(self): def makeusermenus(self):
...@@ -273,9 +265,6 @@ class PythonIDE(Wapplication.Application): ...@@ -273,9 +265,6 @@ class PythonIDE(Wapplication.Application):
def _quit(self): def _quit(self):
import PyConsole, PyEdit import PyConsole, PyEdit
PyConsole.console.writeprefs()
PyConsole.output.writeprefs()
PyEdit.searchengine.writeprefs()
for window in self._windows.values(): for window in self._windows.values():
try: try:
rv = window.close() # ignore any errors while quitting rv = window.close() # ignore any errors while quitting
...@@ -283,6 +272,16 @@ class PythonIDE(Wapplication.Application): ...@@ -283,6 +272,16 @@ class PythonIDE(Wapplication.Application):
rv = 0 # (otherwise, we can get stuck!) rv = 0 # (otherwise, we can get stuck!)
if rv and rv > 0: if rv and rv > 0:
return return
try:
PyConsole.console.writeprefs()
PyConsole.output.writeprefs()
PyEdit.searchengine.writeprefs()
except:
# Write to __stderr__ so the msg end up in Console.app and has
# at least _some_ chance of getting read...
# But: this is a workaround for way more serious problems with
# the Python 2.2 Jaguar addon.
sys.__stderr__.write("*** PythonIDE: Can't write preferences ***\n")
self.quitting = 1 self.quitting = 1
def makehelpmenu(self): def makehelpmenu(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment