File tree 2 files changed +20
-14
lines changed
src/client/common/process
2 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 10
10
print (">>>PYTHON-EXEC-OUTPUT" )
11
11
12
12
module = 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) {
164
164
// run, see `get_output_via_markers.py`.
165
165
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 / ;
166
166
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 ;
169
169
}
170
170
171
171
function removeCondaRunMarkers ( out : string ) {
You can’t perform that action at this time.
0 commit comments