<s> '''<STR_LIT>''' <EOL> from pydevd_constants import * <EOL> import time <EOL> import threading <EOL> import sys <EOL> try : <EOL> import Queue as PydevQueue <EOL> except ImportError : <EOL> import queue as PydevQueue <EOL> from socket import socket <EOL> from socket import AF_INET , SOCK_STREAM <EOL> try : <EOL> from urllib import quote <EOL> except : <EOL> from urllib . parse import quote <EOL> import pydevd_vars <EOL> import pydevd_tracing <EOL> import pydevd_vm_type <EOL> import pydevd_file_utils <EOL> import traceback <EOL> from pydevd_tracing import GetExceptionTracebackStr <EOL> CMD_RUN = <NUM_LIT> <EOL> CMD_LIST_THREADS = <NUM_LIT> <EOL> CMD_THREAD_CREATE = <NUM_LIT> <EOL> CMD_THREAD_KILL = <NUM_LIT> <EOL> CMD_THREAD_SUSPEND = <NUM_LIT> <EOL> CMD_THREAD_RUN = <NUM_LIT> <EOL> CMD_STEP_INTO = <NUM_LIT> <EOL> CMD_STEP_OVER = <NUM_LIT> <EOL> CMD_STEP_RETURN = <NUM_LIT> <EOL> CMD_GET_VARIABLE = <NUM_LIT> <EOL> CMD_SET_BREAK = <NUM_LIT> <EOL> CMD_REMOVE_BREAK = <NUM_LIT> <EOL> CMD_EVALUATE_EXPRESSION = <NUM_LIT> <EOL> CMD_GET_FRAME = <NUM_LIT> <EOL> CMD_EXEC_EXPRESSION = <NUM_LIT> <EOL> CMD_WRITE_TO_CONSOLE = <NUM_LIT> <EOL> CMD_CHANGE_VARIABLE = <NUM_LIT> <EOL> CMD_RUN_TO_LINE = <NUM_LIT> <EOL> CMD_RELOAD_CODE = <NUM_LIT> <EOL> CMD_GET_COMPLETIONS = <NUM_LIT> <EOL> CMD_VERSION = <NUM_LIT> <EOL> CMD_RETURN = <NUM_LIT> <EOL> CMD_ERROR = <NUM_LIT> <EOL> ID_TO_MEANING = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> MAX_IO_MSG_SIZE = <NUM_LIT:1000> <EOL> VERSION_STRING = "<STR_LIT>" <EOL> def PydevdLog ( level , * args ) : <EOL> """<STR_LIT>""" <EOL> if level <= DEBUG_TRACE_LEVEL : <EOL> try : <EOL> sys . stderr . write ( '<STR_LIT>' % ( args , ) ) <EOL> except : <EOL> pass <EOL> class GlobalDebuggerHolder : <EOL> '''<STR_LIT>''' <EOL> globalDbg = None <EOL> def GetGlobalDebugger ( ) : <EOL> return GlobalDebuggerHolder . globalDbg <EOL> def SetGlobalDebugger ( dbg ) : <EOL> GlobalDebuggerHolder . globalDbg = dbg <EOL> class PyDBDaemonThread ( threading . Thread ) : <EOL> def __init__ ( self ) : <EOL> threading . Thread . __init__ ( self ) <EOL> self . setDaemon ( True ) <EOL> self . killReceived = False <EOL> def run ( self ) : <EOL> if sys . platform . startswith ( "<STR_LIT>" ) : <EOL> import org . python . core as PyCore <EOL> ss = PyCore . PySystemState ( ) <EOL> PyCore . Py . setSystemState ( ss ) <EOL> self . OnRun ( ) <EOL> def OnRun ( self ) : <EOL> raise NotImplementedError ( '<STR_LIT>' % self . __class__ ) <EOL> def doKill ( self ) : <EOL> self . killReceived = True <EOL> class ReaderThread ( PyDBDaemonThread ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , sock ) : <EOL> PyDBDaemonThread . __init__ ( self ) <EOL> self . sock = sock <EOL> self . setName ( "<STR_LIT>" ) <EOL> def doKill ( self ) : <EOL> self . killReceived = True <EOL> try : <EOL> self . sock . close ( ) <EOL> except : <EOL> pass <EOL> def OnRun ( self ) : <EOL> pydevd_tracing . SetTrace ( None ) <EOL> buffer = "<STR_LIT>" <EOL> try : <EOL> while not self . killReceived : <EOL> try : <EOL> r = self . sock . recv ( <NUM_LIT> ) <EOL> except : <EOL> GlobalDebuggerHolder . globalDbg . FinishDebuggingSession ( ) <EOL> break <EOL> if IS_PY3K : <EOL> r = r . decode ( '<STR_LIT:utf-8>' ) <EOL> buffer += r <EOL> if DebugInfoHolder . DEBUG_RECORD_SOCKET_READS : <EOL> sys . stdout . write ( '<STR_LIT>' % ( buffer , ) ) <EOL> if len ( buffer ) == <NUM_LIT:0> : <EOL> GlobalDebuggerHolder . globalDbg . FinishDebuggingSession ( ) <EOL> break <EOL> while buffer . find ( '<STR_LIT:\n>' ) != - <NUM_LIT:1> : <EOL> command , buffer = buffer . split ( '<STR_LIT:\n>' , <NUM_LIT:1> ) <EOL> PydevdLog ( <NUM_LIT:1> , "<STR_LIT>" , command ) <EOL> args = command . split ( '<STR_LIT:\t>' , <NUM_LIT:2> ) <EOL> GlobalDebuggerHolder . globalDbg . processNetCommand ( int ( args [ <NUM_LIT:0> ] ) , int ( args [ <NUM_LIT:1> ] ) , args [ <NUM_LIT:2> ] ) <EOL> except : <EOL> traceback . print_exc ( ) <EOL> GlobalDebuggerHolder . globalDbg . FinishDebuggingSession ( ) <EOL> class WriterThread ( PyDBDaemonThread ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , sock ) : <EOL> PyDBDaemonThread . __init__ ( self ) <EOL> self . sock = sock <EOL> self . setName ( "<STR_LIT>" ) <EOL> self . cmdQueue = PydevQueue . Queue ( ) <EOL> if pydevd_vm_type . GetVmType ( ) == '<STR_LIT>' : <EOL> self . timeout = <NUM_LIT:0> <EOL> else : <EOL> self . timeout = <NUM_LIT:0.1> <EOL> def addCommand ( self , cmd ) : <EOL> """<STR_LIT>""" <EOL> self . cmdQueue . put ( cmd ) <EOL> def OnRun ( self ) : <EOL> """<STR_LIT>""" <EOL> pydevd_tracing . SetTrace ( None ) <EOL> try : <EOL> while not self . killReceived : <EOL> try : <EOL> cmd = self . cmdQueue . get ( <NUM_LIT:1> ) <EOL> except : <EOL> return <EOL> out = cmd . getOutgoing ( ) <EOL> if DEBUG_TRACE_LEVEL >= <NUM_LIT:1> : <EOL> out_message = '<STR_LIT>' <EOL> out_message += ID_TO_MEANING . get ( out [ : <NUM_LIT:3> ] , '<STR_LIT>' ) <EOL> out_message += '<STR_LIT:U+0020>' <EOL> out_message += out <EOL> try : <EOL> sys . stderr . write ( '<STR_LIT>' % ( out_message , ) ) <EOL> except : <EOL> pass <EOL> if IS_PY3K : <EOL> out = bytearray ( out , '<STR_LIT:utf-8>' ) <EOL> self . sock . send ( out ) <EOL> if time is None : <EOL> break <EOL> time . sleep ( self . timeout ) <EOL> except Exception : <EOL> GlobalDebuggerHolder . globalDbg . FinishDebuggingSession ( ) <EOL> if DEBUG_TRACE_LEVEL >= <NUM_LIT:0> : <EOL> traceback . print_exc ( ) <EOL> def StartServer ( port ) : <EOL> """<STR_LIT>""" <EOL> s = socket ( AF_INET , SOCK_STREAM ) <EOL> s . bind ( ( '<STR_LIT>' , port ) ) <EOL> s . listen ( <NUM_LIT:1> ) <EOL> newSock , _addr = s . accept ( ) <EOL> return newSock <EOL> def StartClient ( host , port ) : <EOL> """<STR_LIT>""" <EOL> PydevdLog ( <NUM_LIT:1> , "<STR_LIT>" , host , "<STR_LIT::>" , str ( port ) ) <EOL> try : <EOL> s = socket ( AF_INET , SOCK_STREAM ) ; <EOL> s . connect ( ( host , port ) ) <EOL> PydevdLog ( <NUM_LIT:1> , "<STR_LIT>" ) <EOL> return s <EOL> except : <EOL> sys . stderr . write ( "<STR_LIT>" % ( host , port ) ) <EOL> traceback . print_exc ( ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> class NetCommand : <EOL> """<STR_LIT>""" <EOL> next_seq = <NUM_LIT:0> <EOL> def __init__ ( self , id , seq , text ) : <EOL> """<STR_LIT>""" <EOL> self . id = id <EOL> if ( seq == <NUM_LIT:0> ) : seq = self . getNextSeq ( ) <EOL> self . seq = seq <EOL> self . text = text <EOL> self . outgoing = self . makeMessage ( id , seq , text ) <EOL> def getNextSeq ( self ) : <EOL> """<STR_LIT>""" <EOL> NetCommand . next_seq += <NUM_LIT:2> <EOL> return NetCommand . next_seq <EOL> def getOutgoing ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . outgoing <EOL> def makeMessage ( self , cmd , seq , payload ) : <EOL> encoded = quote ( str ( payload ) , '<STR_LIT>' ) <EOL> return str ( cmd ) + '<STR_LIT:\t>' + str ( seq ) + '<STR_LIT:\t>' + encoded + "<STR_LIT:\n>" <EOL> class NetCommandFactory : <EOL> def __init_ ( self ) : <EOL> self . next_seq = <NUM_LIT:0> <EOL> def threadToXML ( self , thread ) : <EOL> """<STR_LIT>""" <EOL> name = pydevd_vars . makeValidXmlValue ( thread . getName ( ) ) <EOL> cmdText = '<STR_LIT>' % ( quote ( name ) , GetThreadId ( thread ) ) <EOL> return cmdText <EOL> def makeErrorMessage ( self , seq , text ) : <EOL> cmd = NetCommand ( CMD_ERROR , seq , text ) <EOL> if DEBUG_TRACE_LEVEL > <NUM_LIT:2> : <EOL> sys . stderr . write ( "<STR_LIT>" % ( text , ) ) <EOL> return cmd ; <EOL> def makeThreadCreatedMessage ( self , thread ) : <EOL> cmdText = "<STR_LIT>" + self . threadToXML ( thread ) + "<STR_LIT>" <EOL> return NetCommand ( CMD_THREAD_CREATE , <NUM_LIT:0> , cmdText ) <EOL> def makeListThreadsMessage ( self , seq ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> t = threading . enumerate ( ) <EOL> cmdText = "<STR_LIT>" <EOL> for i in t : <EOL> if t . isAlive ( ) : <EOL> cmdText += self . threadToXML ( i ) <EOL> cmdText += "<STR_LIT>" <EOL> return NetCommand ( CMD_RETURN , seq , cmdText ) <EOL> except : <EOL> return self . makeErrorMessage ( seq , GetExceptionTracebackStr ( ) ) <EOL> def makeIoMessage ( self , v , ctx , dbg = None ) : <EOL> '''<STR_LIT>''' <EOL> try : <EOL> if len ( v ) > MAX_IO_MSG_SIZE : <EOL> v = v [ <NUM_LIT:0> : MAX_IO_MSG_SIZE ] <EOL> v += '<STR_LIT>' <EOL> v = pydevd_vars . makeValidXmlValue ( quote ( v , '<STR_LIT>' ) ) <EOL> net = NetCommand ( str ( CMD_WRITE_TO_CONSOLE ) , <NUM_LIT:0> , '<STR_LIT>' % ( v , ctx ) ) <EOL> if dbg : <EOL> dbg . writer . addCommand ( net ) <EOL> except : <EOL> return self . makeErrorMessage ( <NUM_LIT:0> , GetExceptionTracebackStr ( ) ) <EOL> def makeVersionMessage ( self , seq ) : <EOL> try : <EOL> return NetCommand ( CMD_VERSION , seq , VERSION_STRING ) <EOL> except : <EOL> return self . makeErrorMessage ( seq , GetExceptionTracebackStr ( ) ) <EOL> def makeThreadKilledMessage ( self , id ) : <EOL> try : <EOL> return NetCommand ( CMD_THREAD_KILL , <NUM_LIT:0> , str ( id ) ) <EOL> except : <EOL> return self . makeErrorMessage ( <NUM_LIT:0> , GetExceptionTracebackStr ( ) ) <EOL> def makeThreadSuspendMessage ( self , thread_id , frame , stop_reason ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> cmdTextList = [ "<STR_LIT>" ] <EOL> cmdTextList . append ( '<STR_LIT>' % ( thread_id , stop_reason ) ) <EOL> curFrame = frame <EOL> while curFrame : <EOL> myId = str ( id ( curFrame ) ) <EOL> if curFrame . f_code is None : <EOL> break <EOL> myName = curFrame . f_code . co_name <EOL> if myName is None : <EOL> break <EOL> myFile = pydevd_file_utils . NormFileToClient ( curFrame . f_code . co_filename ) <EOL> myLine = str ( curFrame . f_lineno ) <EOL> variables = '<STR_LIT>' <EOL> cmdTextList . append ( '<STR_LIT>' % ( myId , pydevd_vars . makeValidXmlValue ( myName ) ) ) <EOL> cmdTextList . append ( '<STR_LIT>' % ( quote ( myFile , '<STR_LIT>' ) , myLine ) ) <EOL> cmdTextList . append ( variables ) <EOL> cmdTextList . append ( "<STR_LIT>" ) <EOL> curFrame = curFrame . f_back <EOL> cmdTextList . append ( "<STR_LIT>" ) <EOL> cmdText = '<STR_LIT>' . join ( cmdTextList ) <EOL> return NetCommand ( CMD_THREAD_SUSPEND , <NUM_LIT:0> , cmdText ) <EOL> except : <EOL> return self . makeErrorMessage ( <NUM_LIT:0> , GetExceptionTracebackStr ( ) ) <EOL> def makeThreadRunMessage ( self , id , reason ) : <EOL> try : <EOL> return NetCommand ( CMD_THREAD_RUN , <NUM_LIT:0> , str ( id ) + "<STR_LIT:\t>" + str ( reason ) ) <EOL> except : <EOL> return self . makeErrorMessage ( <NUM_LIT:0> , GetExceptionTracebackStr ( ) ) <EOL> def makeGetVariableMessage ( self , seq , payload ) : <EOL> try : <EOL> return NetCommand ( CMD_GET_VARIABLE , seq , payload ) <EOL> except Exception : <EOL> return self . makeErrorMessage ( seq , GetExceptionTracebackStr ( ) ) <EOL> def makeGetFrameMessage ( self , seq , payload ) : <EOL> try : <EOL> return NetCommand ( CMD_GET_FRAME , seq , payload ) <EOL> except Exception : <EOL> return self . makeErrorMessage ( seq , GetExceptionTracebackStr ( ) ) <EOL> def makeEvaluateExpressionMessage ( self , seq , payload ) : <EOL> try : <EOL> return NetCommand ( CMD_EVALUATE_EXPRESSION , seq , payload ) <EOL> except Exception : <EOL> return self . makeErrorMessage ( seq , GetExceptionTracebackStr ( ) ) <EOL> def makeGetCompletionsMessage ( self , seq , payload ) : <EOL> try : <EOL> return NetCommand ( CMD_GET_COMPLETIONS , seq , payload ) <EOL> except Exception : <EOL> return self . makeErrorMessage ( seq , GetExceptionTracebackStr ( ) ) <EOL> INTERNAL_TERMINATE_THREAD = <NUM_LIT:1> <EOL> INTERNAL_SUSPEND_THREAD = <NUM_LIT:2> <EOL> class InternalThreadCommand : <EOL> """<STR_LIT>""" <EOL> def canBeExecutedBy ( self , thread_id ) : <EOL> '''<STR_LIT>''' <EOL> return self . thread_id == thread_id <EOL> def doIt ( self , dbg ) : <EOL> raise NotImplementedError ( "<STR_LIT>" ) <EOL> class InternalTerminateThread ( InternalThreadCommand ) : <EOL> def __init__ ( self , thread_id ) : <EOL> self . thread_id = thread_id <EOL> def doIt ( self , dbg ) : <EOL> PydevdLog ( <NUM_LIT:1> , "<STR_LIT>" , str ( self . thread_id ) ) <EOL> cmd = dbg . cmdFactory . makeThreadKilledMessage ( self . thread_id ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> class InternalGetVariable ( InternalThreadCommand ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , seq , thread_id , frame_id , scope , attrs ) : <EOL> self . sequence = seq <EOL> self . thread_id = thread_id <EOL> self . frame_id = frame_id <EOL> self . scope = scope <EOL> self . attributes = attrs <EOL> def doIt ( self , dbg ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> xml = "<STR_LIT>" <EOL> valDict = pydevd_vars . resolveCompoundVariable ( self . thread_id , self . frame_id , self . scope , self . attributes ) <EOL> keys = valDict . keys ( ) <EOL> if hasattr ( keys , '<STR_LIT>' ) : <EOL> keys . sort ( ) <EOL> else : <EOL> keys = sorted ( keys , key = str ) <EOL> for k in keys : <EOL> xml += pydevd_vars . varToXML ( valDict [ k ] , str ( k ) ) <EOL> xml += "<STR_LIT>" <EOL> cmd = dbg . cmdFactory . makeGetVariableMessage ( self . sequence , xml ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> except Exception : <EOL> cmd = dbg . cmdFactory . makeErrorMessage ( self . sequence , "<STR_LIT>" + GetExceptionTracebackStr ( ) ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> class InternalChangeVariable ( InternalThreadCommand ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , seq , thread_id , frame_id , scope , attr , expression ) : <EOL> self . sequence = seq <EOL> self . thread_id = thread_id <EOL> self . frame_id = frame_id <EOL> self . scope = scope <EOL> self . attr = attr <EOL> self . expression = expression <EOL> def doIt ( self , dbg ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> pydevd_vars . changeAttrExpression ( self . thread_id , self . frame_id , self . attr , self . expression ) <EOL> except Exception : <EOL> cmd = dbg . cmdFactory . makeErrorMessage ( self . sequence , "<STR_LIT>" % ( self . attr , self . expression , GetExceptionTracebackStr ( ) ) ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> class InternalGetFrame ( InternalThreadCommand ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , seq , thread_id , frame_id ) : <EOL> self . sequence = seq <EOL> self . thread_id = thread_id <EOL> self . frame_id = frame_id <EOL> def doIt ( self , dbg ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> try : <EOL> xml = "<STR_LIT>" <EOL> frame = pydevd_vars . findFrame ( self . thread_id , self . frame_id ) <EOL> xml += pydevd_vars . frameVarsToXML ( frame ) <EOL> del frame <EOL> xml += "<STR_LIT>" <EOL> cmd = dbg . cmdFactory . makeGetFrameMessage ( self . sequence , xml ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> except pydevd_vars . FrameNotFoundError : <EOL> cmd = dbg . cmdFactory . makeErrorMessage ( self . sequence , "<STR_LIT>" % ( self . frame_id , self . thread_id ) ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> except : <EOL> cmd = dbg . cmdFactory . makeErrorMessage ( self . sequence , "<STR_LIT>" % ( self . frame_id , self . thread_id ) ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> class InternalEvaluateExpression ( InternalThreadCommand ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , seq , thread_id , frame_id , expression , doExec ) : <EOL> self . sequence = seq <EOL> self . thread_id = thread_id <EOL> self . frame_id = frame_id <EOL> self . expression = expression <EOL> self . doExec = doExec <EOL> def doIt ( self , dbg ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> result = pydevd_vars . evaluateExpression ( self . thread_id , self . frame_id , self . expression , self . doExec ) <EOL> xml = "<STR_LIT>" <EOL> xml += pydevd_vars . varToXML ( result , "<STR_LIT>" ) <EOL> xml += "<STR_LIT>" <EOL> cmd = dbg . cmdFactory . makeEvaluateExpressionMessage ( self . sequence , xml ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> except : <EOL> exc = GetExceptionTracebackStr ( ) <EOL> sys . stderr . write ( '<STR_LIT>' % ( exc , ) ) <EOL> cmd = dbg . cmdFactory . makeErrorMessage ( self . sequence , "<STR_LIT>" + exc ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> class InternalGetCompletions ( InternalThreadCommand ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , seq , thread_id , frame_id , act_tok ) : <EOL> self . sequence = seq <EOL> self . thread_id = thread_id <EOL> self . frame_id = frame_id <EOL> self . act_tok = act_tok <EOL> def doIt ( self , dbg ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> remove_path = None <EOL> try : <EOL> import _completer <EOL> except : <EOL> path = os . environ [ '<STR_LIT>' ] <EOL> sys . path . append ( path ) <EOL> remove_path = path <EOL> import _completer <EOL> try : <EOL> frame = pydevd_vars . findFrame ( self . thread_id , self . frame_id ) <EOL> updated_globals = dict ( ) <EOL> updated_globals . update ( frame . f_globals ) <EOL> updated_globals . update ( frame . f_locals ) <EOL> completer = _completer . Completer ( updated_globals , None ) <EOL> completions = completer . complete ( self . act_tok ) <EOL> def makeValid ( s ) : <EOL> return pydevd_vars . makeValidXmlValue ( pydevd_vars . quote ( s , '<STR_LIT>' ) ) <EOL> msg = "<STR_LIT>" <EOL> for comp in completions : <EOL> msg += '<STR_LIT>' % ( makeValid ( comp [ <NUM_LIT:0> ] ) , makeValid ( comp [ <NUM_LIT:1> ] ) , makeValid ( comp [ <NUM_LIT:2> ] ) , makeValid ( comp [ <NUM_LIT:3> ] ) , ) <EOL> msg += "<STR_LIT>" <EOL> cmd = dbg . cmdFactory . makeGetCompletionsMessage ( self . sequence , msg ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> finally : <EOL> if remove_path is not None : <EOL> sys . path . remove ( remove_path ) <EOL> except : <EOL> exc = GetExceptionTracebackStr ( ) <EOL> sys . stderr . write ( '<STR_LIT>' % ( exc , ) ) <EOL> cmd = dbg . cmdFactory . makeErrorMessage ( self . sequence , "<STR_LIT>" + exc ) <EOL> dbg . writer . addCommand ( cmd ) <EOL> def PydevdFindThreadById ( thread_id ) : <EOL> try : <EOL> threads = threading . enumerate ( ) <EOL> for i in threads : <EOL> if thread_id == GetThreadId ( i ) : <EOL> return i <EOL> sys . stderr . write ( "<STR_LIT>" % thread_id ) <EOL> sys . stderr . write ( "<STR_LIT>" % [ GetThreadId ( t ) for t in threads ] ) <EOL> except : <EOL> traceback . print_exc ( ) <EOL> return None </s>
