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