def __init__(self, path=None): self.device = None self.target = None self.lock = threading.Lock() if path and not self.open(path): raise IOError(errno.ENODEV, os.strerror(errno.ENODEV))