mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -11,10 +11,10 @@ os.environ['TERM'] = 'emacs' #to use proper page_more() for paging
|
||||
#raise ImportError()
|
||||
|
||||
try:
|
||||
from pydev_ipython_console_010 import PyDevFrontEnd
|
||||
except:
|
||||
#IPython 0.11 broke compatibility...
|
||||
from pydev_ipython_console_011 import PyDevFrontEnd
|
||||
except:
|
||||
from pydev_ipython_console_010 import PyDevFrontEnd
|
||||
|
||||
#=======================================================================================================================
|
||||
# InterpreterInterface
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
|
||||
try:
|
||||
from IPython.terminal.interactiveshell import TerminalInteractiveShell
|
||||
except ImportError:
|
||||
from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
|
||||
from IPython.utils import io
|
||||
import sys
|
||||
import codeop, re
|
||||
|
||||
@@ -155,6 +155,13 @@ class PyDBCommandThread(PyDBDaemonThread):
|
||||
#PydevdLog(0, 'Finishing debug communication...(3)')
|
||||
|
||||
|
||||
def killAllPydevThreads():
|
||||
threads = threadingEnumerate()
|
||||
for t in threads:
|
||||
if hasattr(t, 'doKillPydevThread'):
|
||||
t.doKillPydevThread()
|
||||
|
||||
|
||||
#=======================================================================================================================
|
||||
# PyDBCheckAliveThread
|
||||
#=======================================================================================================================
|
||||
@@ -174,10 +181,7 @@ class PyDBCheckAliveThread(PyDBDaemonThread):
|
||||
try:
|
||||
pydev_log.debug("No alive threads, finishing debug session")
|
||||
self.pyDb.FinishDebuggingSession()
|
||||
threads = threadingEnumerate()
|
||||
for t in threads:
|
||||
if hasattr(t, 'doKillPydevThread'):
|
||||
t.doKillPydevThread()
|
||||
killAllPydevThreads()
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -1351,6 +1355,36 @@ def _locked_settrace(host, stdoutToServer, stderrToServer, port, suspend, trace_
|
||||
if suspend:
|
||||
debugger.setSuspend(t, CMD_SET_BREAK)
|
||||
|
||||
def stoptrace():
|
||||
global connected
|
||||
if connected:
|
||||
pydevd_tracing.RestoreSysSetTraceFunc()
|
||||
sys.settrace(None)
|
||||
try:
|
||||
#not available in jython!
|
||||
threading.settrace(None) # for all future threads
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
thread.start_new_thread = _original_start_new_thread
|
||||
thread.start_new = _original_start_new_thread
|
||||
except:
|
||||
pass
|
||||
|
||||
debugger = GetGlobalDebugger()
|
||||
|
||||
if debugger:
|
||||
debugger.trace_dispatch = None
|
||||
|
||||
debugger.SetTraceForFrameAndParents(GetFrame(), False)
|
||||
|
||||
debugger.exiting()
|
||||
|
||||
killAllPydevThreads()
|
||||
|
||||
connected = False
|
||||
|
||||
class Dispatcher(object):
|
||||
def __init__(self):
|
||||
self.port = None
|
||||
|
||||
@@ -171,7 +171,11 @@ def varToXML(val, name, doTrim=True):
|
||||
except:
|
||||
value = 'Unable to get repr for %s' % v.__class__
|
||||
|
||||
xml = '<var name="%s" type="%s"' % (makeValidXmlValue(quote(name, '/>_= ')), makeValidXmlValue(typeName))
|
||||
try:
|
||||
name = quote(name, '/>_= ') #TODO: Fix PY-5834 without using quote
|
||||
except:
|
||||
pass
|
||||
xml = '<var name="%s" type="%s"' % (makeValidXmlValue(name), makeValidXmlValue(typeName))
|
||||
|
||||
if value:
|
||||
#cannot be too big... communication may not handle it.
|
||||
|
||||
Reference in New Issue
Block a user