mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-23 18:54:05 +01:00
utils: ignore missing services in unregisterService instead of raising an error
This is a prerequisite for the next commit (service spawn toggle options). (#403)
This commit is contained in:
parent
a0ed43bf64
commit
a776aab897
6
utils.py
6
utils.py
@ -493,8 +493,12 @@ def registerService(name, *args, **kwargs):
|
||||
|
||||
def unregisterService(name):
|
||||
"""Unregisters an existing service bot."""
|
||||
assert name in world.services, "Unknown service %s" % name
|
||||
name = name.lower()
|
||||
|
||||
if name not in world.services:
|
||||
# Service bot doesn't exist; ignore.
|
||||
return
|
||||
|
||||
sbot = world.services[name]
|
||||
for ircnet, uid in sbot.uids.items():
|
||||
ircobj = world.networkobjects[ircnet]
|
||||
|
Loading…
Reference in New Issue
Block a user