diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fb40386fe49577f70ffae54a3a69e0da8f2fb1c..cf06950c36db8d6c593e5ac3d213c017cb82c2e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: &variables CXXFLAGS: "-g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wdate-time -Wextra -Wformat=2" DEBIAN_FRONTEND: "noninteractive" DOCTEST_GIT_REPOSITORY: "https://github.com/gnu-octave/octave-doctest.git" - DOCTEST_GIT_TAG: "v0.8.0" + DOCTEST_GIT_TAG: "v0.8.1" DOCTEST_ROOT: "/tmp/doctest" LIBSSL_DEV: "libssl-dev" PYENV_GIT_REPOSITORY: "https://github.com/pyenv/pyenv.git" @@ -140,9 +140,13 @@ python3.13: PYTHON_VERSION_FULL: "3.13.7" extends: .test:pyenv -# Expected to fail, Issue #136 -python3.11-octave9.4.0: - extends: python3.11 +python3.13-octave10.2.0: + extends: python3.13 + image: gnuoctave/octave:10.2.0 + allow_failure: true + +python3.12-octave9.4.0: + extends: python3.12 image: gnuoctave/octave:9.4.0 allow_failure: true @@ -282,7 +286,9 @@ macos_tests: - brew --version - brew install gnu-sed - brew info octave - - brew install octave@8.4.0 + # note as of 2025-09 octave@8.4.0 pinning doesn't work + # so we're sort of at the wim of HomeBrew what Octave we get + - brew install octave script: - gcc --version - clang --version diff --git a/inst/@pyobject/subsref.m b/inst/@pyobject/subsref.m index 13b6a9ba092df67a58f21275f7b89f3f4c0dcfb0..bd9b0ae8339f54e907a33abc2b3cc3e4d7d43db9 100644 --- a/inst/@pyobject/subsref.m +++ b/inst/@pyobject/subsref.m @@ -118,6 +118,17 @@ function varargout = subsref (x, idx) elseif (nargout == 1) varargout{1} = r; elseif (nargout >= 2) + % Octave bug https://savannah.gnu.org/bugs/?67506 means x{"string"} + % erroneously sets nargout = length("string"). Try to workaround... + if (t.type == "{}" && compare_versions (ver ("Octave").Version, "9.0.0", ">=")) + % TODO: hopefully fixed for 11 + % && compare_versions (ver ("Octave").Version, "11.0.0", "<") + if (isa (t.subs{1}, 'char') && nargout == length (t.subs{1})) + % in this special special case, we assume one argument (won't always be right!) + varargout{1} = r; + return + end + end assert (length (r) == nargout, ... "pyobject/subsref: number of outputs must match") [varargout{1:nargout}] = subsref (r, struct ("type", "{}", "subs", {{1:nargout}}));