panic should not occur when host attribute does not exist #281
sb10q
commented 2022-04-27 17:30:39 +08:00
Owner
```
from artiq.experiment import *
from artiq.coredevice.core import Core
from artiq.coredevice.ttl import TTLOut
@nac3
class CorePause(EnvExperiment):
core: KernelInvariant[Core]
led: KernelInvariant[TTLOut]
def build(self):
self.setattr_device("core")
@kernel
def run(self):
pass
```
```
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'AttributeError'>, value: AttributeError("'CorePause' object has no attribute 'led'"), traceback: None }', nac3artiq/src/symbol_resolver.rs:1100:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
File "/nix/store/qar69gl7dj6qsxzbfnad2zxydqzys22f-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 174, in main
return run(with_file=True)
File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 155, in run
exp_inst.run()
File "/home/sb/artiq/artiq/language/core.py", line 79, in run_on_core
self.core.run(fake_method, args, kwargs)
File "/home/sb/artiq/artiq/coredevice/core.py", line 83, in run
kernel_library = self.compile(function, args, kwargs, embedding_map)
File "/home/sb/artiq/artiq/coredevice/core.py", line 77, in compile
return self.compiler.compile_method_to_mem(obj, name, args, embedding_map)
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'AttributeError'>, value: AttributeError("'CorePause' object has no attribute 'led'"), traceback: None }
```
sb10q
added this to the Alpha milestone 2022-04-27 17:30:47 +08:00
ychenfo
referenced this issue 2022-05-15 02:09:52 +08:00
Err instead of panic for host object attribute error #288
sb10q
closed this issue 2022-05-18 06:36:21 +08:00
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#281
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?