Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve registration robustness for instances of registered classes #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
/.eggs/
/.mypy_cache/
/.pytest_cache/
.venv/
3 changes: 2 additions & 1 deletion Pyro5/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ def register(self, obj_or_class, objectId=None, force=False, weak=False):
if not hasattr(obj_or_class, "_pyroInstancing"):
obj_or_class._pyroInstancing = ("session", None)
if not force:
if hasattr(obj_or_class, "_pyroId") and obj_or_class._pyroId != "": # check for empty string is needed for Cython
pyro_id = getattr(obj_or_class, "_pyroId", None)
if pyro_id and self.objectsById[pyro_id] is obj_or_class:
raise errors.DaemonError("object or class already has a Pyro id")
if objectId in self.objectsById:
raise errors.DaemonError("an object or class is already registered with that id")
Expand Down