user-defined exceptions are broken in ARTIQ #200

Closed
opened 2022-02-28 12:00:44 +08:00 by sb10q · 1 comment
from artiq.experiment import *
from artiq.coredevice.core import Core


@nac3
class Test(Exception):
    pass

@nac3
class NAC3Devices(EnvExperiment):
    core: KernelInvariant[Core]

    def build(self):
        self.setattr_device("core")

    @kernel
    def run(self):
        raise Test()
> artiq_run nac3devices.py
WARNING:artiq.coredevice.comm_kernel:Mismatch between gateware (7.7987.9bfbd39.beta) and software (8.unknown.beta) versions
Traceback (most recent call last):
  File "/nix/store/vapyv9sw42s4ab10x03vrh8kczn5j67m-python3.9-artiq-8.0.unknown.beta/bin/.artiq_run-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 171, in main
    return run(with_file=True)
  File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 157, in run
    raise exn
  File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 152, in run
    exp_inst.run()
  File "/home/sb/artiq/artiq/language/core.py", line 75, in run_on_core
    self.core.run(fake_method, args, kwargs)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 92, in run
    self.comm.serve(self.embedding_map, symbolizer)
  File "/home/sb/artiq/artiq/coredevice/comm_kernel.py", line 800, in serve
    self._serve_exception(embedding_map, symbolizer)
  File "/home/sb/artiq/artiq/coredevice/comm_kernel.py", line 775, in _serve_exception
    python_exn_type = getattr(exceptions, core_exn.name.split('.')[-1])
AttributeError: module 'artiq.coredevice.exceptions' has no attribute 'Test'

```python from artiq.experiment import * from artiq.coredevice.core import Core @nac3 class Test(Exception): pass @nac3 class NAC3Devices(EnvExperiment): core: KernelInvariant[Core] def build(self): self.setattr_device("core") @kernel def run(self): raise Test() ``` ``` > artiq_run nac3devices.py WARNING:artiq.coredevice.comm_kernel:Mismatch between gateware (7.7987.9bfbd39.beta) and software (8.unknown.beta) versions Traceback (most recent call last): File "/nix/store/vapyv9sw42s4ab10x03vrh8kczn5j67m-python3.9-artiq-8.0.unknown.beta/bin/.artiq_run-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 171, in main return run(with_file=True) File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 157, in run raise exn File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 152, in run exp_inst.run() File "/home/sb/artiq/artiq/language/core.py", line 75, in run_on_core self.core.run(fake_method, args, kwargs) File "/home/sb/artiq/artiq/coredevice/core.py", line 92, in run self.comm.serve(self.embedding_map, symbolizer) File "/home/sb/artiq/artiq/coredevice/comm_kernel.py", line 800, in serve self._serve_exception(embedding_map, symbolizer) File "/home/sb/artiq/artiq/coredevice/comm_kernel.py", line 775, in _serve_exception python_exn_type = getattr(exceptions, core_exn.name.split('.')[-1]) AttributeError: module 'artiq.coredevice.exceptions' has no attribute 'Test' ```
sb10q added this to the Prealpha milestone 2022-02-28 12:00:44 +08:00
sb10q added the
high-priority
label 2022-02-28 12:00:44 +08:00
pca006132 was assigned by sb10q 2022-02-28 12:00:51 +08:00

Ah forgot to put this change to artiq: a5e1da0b92

Ah forgot to put this change to artiq: https://git.m-labs.hk/M-Labs/nac3/commit/a5e1da0b92cd5ae45d1a87756a1f0827af5feecd
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#200
There is no content yet.