Skip to content

Conversation

@fabaff
Copy link

@fabaff fabaff commented Jan 5, 2026

Fixes issue with Python 3.14

[....]
       > self = <pscript.commonast.NativeAstConverter object at 0x7ffff48143d0>
       > n = Constant(value='a', kind=None)
       >
       >     def _convert_index_like(self, n):
       >         c = self._convert
       > >       if isinstance(n, (ast.Slice, ast.Index, ast.ExtSlice, ast.Ellipsis)):
       >                                                               ^^^^^^^^^^^^
       > E       AttributeError: module 'ast' has no attribute 'Ellipsis'
       >
       > pscript/commonast.py:1035: AttributeError
       > =========================== short test summary info ============================
       > FAILED tests/test_commonast.py::test_consistent_ast1 - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser1.py::TestExpressions::test_indexing_and_slicing - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser1.py::TestExpressions::test_assignments - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser1.py::TestExpressions::test_dict_literals - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser1.py::TestExpressions::test_funcion_call - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser1.py::TestExpressions::test_delete - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser2.py::TestConrolFlow::test_for - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser2.py::TestConrolFlow::test_listcomp_regressions - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser3.py::TestOtherBuiltins::test_repr - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > FAILED tests/test_parser3.py::TestDictMethods::test_copy - AttributeError: module 'ast' has no attribute 'Ellipsis'
       > ================ 10 failed, 213 passed, 1 deselected in 31.37s =================
``

@almarklein
Copy link
Member

Could you add Py314 to CI by duplicating plus adjusting these lines:

- name: Linux py 3.13
os: ubuntu-latest
pyversion: '3.13'

Also please run ruff format from the repo roor to fix the linting errors (Ruff sometimes updates, requiring reformatting).

@almarklein
Copy link
Member

mmm, I guess we'd still want Ellipses in that tuple for Python < 3.14. Maybe it'd be better to have something like?

if python_version < (3, 14):
   Ellipses = ast.Ellipses
else:
   Ellipses = ast.Constant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants