| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -277,14 +277,14 @@ export class PythonShell extends EventEmitter{ | |||
| 277 | 277 | * @param {Function} callback The callback function to invoke with the script results | |
| 278 | 278 | * @return {PythonShell} The PythonShell instance | |
| 279 | 279 | */ | |
| 280 | - static run(scriptPath:string, options?:Options, callback?:(err?:PythonShellError, output?:any[])=>any) { | ||
| 280 | + static run(scriptPath:string, options?:Options, callback?:(output:ReturnType<PythonShell["parser"]>[], err?:PythonShellError, exitCode?: number, exitSignal?: string)=>any) { | ||
| 281 | 281 | let pyshell = new PythonShell(scriptPath, options); | |
| 282 | 282 | let output = []; | |
| 283 | 283 | ||
| 284 | 284 | return pyshell.on('message', function (message) { | |
| 285 | 285 | output.push(message); | |
| 286 | - }).end(function (err) { | ||
| 287 | - return callback(err? err : null, output.length ? output : null); | ||
| 286 | + }).end(function (err, exitCode, exitSignal) { | ||
| 287 | + return callback(output, err? err : null, exitCode, exitSignal); | ||
| 288 | 288 | }); | |
| 289 | 289 | }; | |
| 290 | 290 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments