File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 22
33function pid = get_pid()
44
5- try
5+ if ~isMATLABReleaseOlderThan( ' R2025a ' )
66 pid = matlabProcessID ;
7- catch e
8- switch e .identifier
9- case " MATLAB:UndefinedFunction" , pid = feature(" getpid" );
10- case " Octave:undefined-function" , pid = getpid();
11- otherwise , rethrow(e )
12- end
13-
14- pid = uint64(pid );
7+ elseif stdlib .isoctave()
8+ pid = getpid();
9+ else
10+ pid = feature(" getpid" );
1511end
1612
13+ pid = uint64(pid );
14+
1715end
1816
1917% !assert (get_pid() > 0, "expected positive PID")
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ function test_samepath_notexist(tc)
5050function test_get_pid(tc )
5151pid = stdlib .get_pid();
5252tc .verifyGreaterThan(pid , 0 )
53+ tc .verifyClass(pid , ' uint64' )
5354end
5455
5556
You can’t perform that action at this time.
0 commit comments