diff --git a/jupyter_ydoc/ybasedoc.py b/jupyter_ydoc/ybasedoc.py index a365e2d..18032ac 100644 --- a/jupyter_ydoc/ybasedoc.py +++ b/jupyter_ydoc/ybasedoc.py @@ -121,7 +121,7 @@ def dirty(self) -> bool | None: """ try: return self._ystate.dirty - except AttributeError: + except KeyError: return None @dirty.setter @@ -144,7 +144,7 @@ def hash(self) -> str | None: """ try: return self._ystate.hash - except AttributeError: + except KeyError: return None @hash.setter @@ -167,7 +167,7 @@ def path(self) -> str | None: """ try: return self._ystate.path - except AttributeError: + except KeyError: return None @path.setter diff --git a/jupyter_ydoc/yblob.py b/jupyter_ydoc/yblob.py index a282ec6..890a6bb 100644 --- a/jupyter_ydoc/yblob.py +++ b/jupyter_ydoc/yblob.py @@ -70,7 +70,7 @@ def get(self) -> bytes: """ try: return self._ysource.bytes - except AttributeError: + except KeyError: return b"" def set(self, value: bytes) -> None: