Skip to content

Commit c87ee81

Browse files
committed
Remove redundant _signalPatched reset in isolate functions
Eliminated unnecessary assignments to _signalPatched in _ensurePythonIsolate and _restartPythonIsolate, as the variable is not required to be reset in these contexts.
1 parent bca7a85 commit c87ee81

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/serious_python_android/lib/src/cpython.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Future<String> runPythonProgramFFI(bool sync, String dynamicLibPath,
3838
await _ensurePythonIsolate();
3939

4040
final response = ReceivePort();
41-
_pythonSendPort!.send(
42-
[response.sendPort, dynamicLibPath, pythonProgramPath, script]);
41+
_pythonSendPort!
42+
.send([response.sendPort, dynamicLibPath, pythonProgramPath, script]);
4343
try {
4444
final result = await response.first
4545
.timeout(_pythonRunTimeout, onTimeout: () => "<timeout>");
@@ -88,15 +88,13 @@ Future<void> _ensurePythonIsolate() async {
8888
_pythonIsolate = await Isolate.spawn(_pythonIsolateMain, readyPort.sendPort);
8989
_pythonSendPort = await readyPort.first as SendPort;
9090
readyPort.close();
91-
_signalPatched = false;
9291
}
9392

9493
void _restartPythonIsolate() {
9594
_pyLog("restarting Python isolate");
9695
_pythonIsolate?.kill(priority: Isolate.immediate);
9796
_pythonIsolate = null;
9897
_pythonSendPort = null;
99-
_signalPatched = false;
10098
}
10199

102100
Future<String> runPythonProgramInIsolate(List<Object> arguments) async {

0 commit comments

Comments
 (0)