Skip to content

Commit

Permalink
Replace AttributeError with KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Jan 8, 2025
1 parent 0267765 commit 0f89672
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions jupyter_ydoc/ybasedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def dirty(self) -> bool | None:
"""
try:
return self._ystate.dirty
except AttributeError:
except KeyError:
return None

@dirty.setter
Expand All @@ -144,7 +144,7 @@ def hash(self) -> str | None:
"""
try:
return self._ystate.hash
except AttributeError:
except KeyError:
return None

@hash.setter
Expand All @@ -167,7 +167,7 @@ def path(self) -> str | None:
"""
try:
return self._ystate.path
except AttributeError:
except KeyError:
return None

@path.setter
Expand Down
2 changes: 1 addition & 1 deletion jupyter_ydoc/yblob.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0f89672

Please sign in to comment.