CircuitPython version
Adafruit CircuitPython 9.2.0 on 2024-10-28; Raspberry Pi Pico with rp2040
Code/REPL
import board
from i2ctarget import I2CTarget
device = I2CTarget(board.GP3, board.GP2, (0x40,))
Behavior
Do the above once, then do ctrl-D, then do it again.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: I2C peripheral in use
Without looking at all, I'm thinking switching to a finaliser will fix this. Should also check other ports.