Skip to content

unable to differentiate internal AssertionError from type errors by exit code #20633

Description

@cburroughs

Per #6003 "in case of a crash, bad arguments, and other non-standard conditions" should result in an exit code of 2, but currently on AssertionError mypy returns 1 which makes it impossible to differentiate from type errors.

#16214 contains a current reproduction case that throw an AssertionError.

$ tox -e lint
...
Traceback (most recent call last):
  File "/home/ecsb/src/o/qiskit-serverless/client/.tox/lint/bin/mypy", line 7, in <module>
    sys.exit(console_entry())
             ^^^^^^^^^^^^^^^
  File "/home/ecsb/src/o/qiskit-serverless/client/.tox/lint/lib/python3.12/site-packages/mypy/__main__.py", line 15, in console_entry
    main()
  File "mypy/main.py", line 144, in main
  File "mypy/main.py", line 219, in run_build
  File "mypy/build.py", line 222, in build
  File "mypy/build.py", line 301, in _build
  File "mypy/build.py", line 2952, in dispatch
  File "mypy/build.py", line 3347, in process_graph
  File "mypy/build.py", line 925, in wait_for_done
  File "mypy/build.py", line 3455, in process_stale_scc
  File "mypy/build.py", line 3415, in process_fresh_modules
  File "mypy/build.py", line 2135, in fix_cross_refs
  File "mypy/fixup.py", line 53, in fixup_module
  File "mypy/fixup.py", line 131, in visit_symbol_table
  File "mypy/lookup.py", line 33, in lookup_fully_qualified
AssertionError: Cannot find module for google
lint: exit 1 (25.06 seconds) /home/ecsb/src/o/qiskit-serverless/client> mypy --install-types --non-interactive . pid=25623
  lint: FAIL code 1 (193.29=setup[152.55]+cmd[0.88,14.80,25.06] seconds)
  evaluation failed :( (193.31 seconds)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions