File tree Expand file tree Collapse file tree
src/client/common/process Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010print (">>>PYTHON-EXEC-OUTPUT" )
1111
1212module = sys .argv [1 ]
13- if module == "-c" :
14- ns = {}
15- for code in sys .argv [2 :]:
16- exec (code , ns , ns )
17- elif module .startswith ("-" ):
18- raise NotImplementedError (sys .argv )
19- elif module .endswith (".py" ):
20- runpy .run_path (module , run_name = "__main__" )
21- else :
22- runpy .run_module (module , run_name = "__main__" , alter_sys = True )
23-
24- print ("<<<PYTHON-EXEC-OUTPUT" )
13+ try :
14+ if module == "-c" :
15+ ns = {}
16+ for code in sys .argv [2 :]:
17+ exec (code , ns , ns )
18+ elif module .startswith ("-m" ):
19+ moduleName = sys .argv [2 ]
20+ sys .argv = sys .argv [2 :] # It should begin with the module name.
21+ runpy .run_module (moduleName , run_name = "__main__" , alter_sys = True )
22+ elif module .endswith (".py" ):
23+ sys .argv = sys .argv [1 :]
24+ runpy .run_path (module , run_name = "__main__" )
25+ elif module .startswith ("-" ):
26+ raise NotImplementedError (sys .argv )
27+ else :
28+ runpy .run_module (module , run_name = "__main__" , alter_sys = True )
29+ finally :
30+ print ("<<<PYTHON-EXEC-OUTPUT" )
Original file line number Diff line number Diff line change @@ -164,8 +164,8 @@ function filterOutputUsingCondaRunMarkers(stdout: string) {
164164 // run, see `get_output_via_markers.py`.
165165 const regex = / > > > P Y T H O N - E X E C - O U T P U T ( [ \s \S ] * ) < < < P Y T H O N - E X E C - O U T P U T / ;
166166 const match = stdout . match ( regex ) ;
167- const filteredOut = match !== null && match . length >= 2 ? match [ 1 ] . trim ( ) : '' ;
168- return filteredOut . length ? filteredOut : stdout ;
167+ const filteredOut = match !== null && match . length >= 2 ? match [ 1 ] . trim ( ) : undefined ;
168+ return filteredOut !== undefined ? filteredOut : stdout ;
169169}
170170
171171function removeCondaRunMarkers ( out : string ) {
You can’t perform that action at this time.
0 commit comments